Skip to content

Update deploy.yml

Update deploy.yml #7

Workflow file for this run

name: Portfolio Deploy

Check failure on line 1 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: deployment
on: [push] # tells github to run this on any push to the repository
jobs:
deployment:
runs-on: ubuntu-latest
environment: production
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our master branch (so we don't put unfinished branches in production)
steps:
- name: Deploying to AWS
uses: appleboy/ssh-action@master # An action made to control Linux servers
with: # We set all our secrets here for the action, these won't be shown in the action logs
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd ${{ secrets.APPDIR }}
git pull # we pull any changes from git
npm prune # we remove any unused dependencies
npm install # we install any missing dependencies
npm run build # we build our app
pm2 reload all # we reload the app via PM2