Merge pull request #17 from IsuruSandaruwan97/development #10
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: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Deploy to VPS via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USER }} | |
key: ${{ secrets.VPS_PRIVATE_KEY }} | |
port: ${{ secrets.VPS_PORT }} | |
script: | | |
cd /root/inventory-management-api | |
git pull origin master | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
npm install | |
npx prisma migrate deploy | |
npm run build | |
pm2 restart all # Or the command to restart your application | |