Skip to content

Move production deployment config to GitHub workflows #1

Move production deployment config to GitHub workflows

Move production deployment config to GitHub workflows #1

name: Deploy to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install SSH key
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no deploy@195.200.15.145 << 'EOF'
cd /var/www/porotein
git pull
cd /var/www/porotein/app
pnpm install
pnpm build
cd /var/www/porotein/api
pnpm install
pnpm build
pm2 restart api
sudo systemctl reload nginx
EOF