add prisma prod migration #5
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 Production | |
on: | |
push: | |
branches: | |
- production | |
jobs: | |
redeploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: executing remote ssh commands using ssh keys | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
cd ~/0txt | |
# git reset --hard | |
# git clean -fd | |
git checkout production | |
git pull origin production | |
npm install | |
npx prisma generate | |
npx prisma migrate deploy | |
npm run lint | |
npm run build | |
pm2 stop 0txt-prod || true | |
pm2 start npm --name "0txt-prod" -- run start | |
pm2 save |