Skip to content

Merge pull request #5 from DevsDomain/DN-28-Conectar-Banco-de-dados #12

Merge pull request #5 from DevsDomain/DN-28-Conectar-Banco-de-dados

Merge pull request #5 from DevsDomain/DN-28-Conectar-Banco-de-dados #12

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
pm2 stop src
npm i && pm2 start src