Skip to content

Merge pull request #65 from DevsDomain/DN-85-FD #114

Merge pull request #65 from DevsDomain/DN-85-FD

Merge pull request #65 from DevsDomain/DN-85-FD #114

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