fix: 🐛 oops toggle inflation manual check #281
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 | |
on: | |
push: | |
branches: | |
- main | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Update and Restart Node Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
script: | | |
cd /home/tarnum/itemdb/ | |
git fetch origin main | |
git reset --hard FETCH_HEAD | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
yarn | |
npx prisma migrate deploy | |
pm2 stop ecosystem.config.js | |
BUILD_DIR=temp yarn build || exit | |
if [ ! -d "temp" ]; then | |
echo '\033[31m temp directory does not exist!\033[0m' | |
exit 1; | |
fi | |
# delete `.next` folder | |
rm -rf .next | |
# rename `temp` folder to `.next` | |
mv temp .next | |
pm2 reload ecosystem.config.js |