Burndown #25
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: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Deploy do backend com SSH" | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: "root" | |
key: ${{secrets.VPS_SSH_KEY}} | |
port: 22 | |
script: | | |
cd /home/Dnutri | |
git pull origin main | |
export NVM_DIR='/root/.nvm'; | |
source \$NVM_DIR/nvm.sh; | |
export PATH=/root/.nvm/versions/node/v22.7.0/bin:\$PATH; | |
cd backend/src | |
pm2 stop all | |
npm i && pm2 start index.ts --name backend --interpreter ts-node | |