new graphics #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credits to https://github.com/renanlecaro | |
name: Deploy Meteor App to Server | |
on: | |
push: | |
branches-ignore: | |
- p/* | |
workflow_dispatch: | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
environment: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }} | |
steps: | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
name: id_rsa_github_actor | |
# Test SSH connectivity (fail fast) | |
- name: Test ssh key to fail fast | |
run: ssh ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} -i ~/.ssh/id_rsa_github_actor -t "pwd" | |
- uses: actions/checkout@v2 | |
- name: Get production dependencies only | |
run: cd ./app && npm ci --omit=dev | |
- name: (Hack) Remove malformed package | |
run: find ./app/node_modules -name malformed_package_json -type d -prune -exec rm -rf "{}" \; | |
- name: Install meteor | |
run: curl https://install.meteor.com/ | sh | |
- name: Bundle the app and upload to Hoster | |
run: cd ./deploy && npm i && npx mup deploy | |
env: | |
SSH_USER: ${{ vars.SSH_USER }} | |
SSH_HOST: ${{ vars.SSH_HOST }} | |
DOMAIN: ${{ vars.DOMAIN }} | |
PROXY_PORT: ${{ vars.PROXY_PORT }} |