Merge pull request #11 from neerajsde/neeraj #12
This file contains hidden or 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: ReelTube Backend Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to VPS | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_KEY }} | |
| script: | | |
| cd /var/www/social-media-backend | |
| export NVM_DIR="$HOME/.nvm" | |
| source $NVM_DIR/nvm.sh | |
| nvm use 20 | |
| git pull origin main | |
| npm install | |
| npx prisma generate | |
| npx prisma migrate deploy | |
| npm run build | |
| npx pm2 restart social-backend || pm2 start dist/server.js --name social-backend |