Fix CI/CD #17
Workflow file for this run
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
name: Deploy to VPS | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Deploy to VPS | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USERNAME }} | |
key: ${{ secrets.VPS_SSH_KEY }} | |
script: | | |
npm install -g pnpm pm2 | |
cd ~/gov-api | |
git pull origin main | |
pnpm install | |
pnpm run build | |
pm2 reload gov-api || pm2 start dist/main.js --name gov-api --time |