fix: 🐛 restock hub preload query #746
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: itemdb Blue (main) - Deploy | |
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 --only itemdb-web | |
pm2 start itemdb-green | |
yarn build || exit | |
pm2 stop itemdb-green | |
pm2 reload ecosystem.config.js --only itemdb-web --update-env | |
- name: itemdb Green (backup) - Update | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
script: | | |
cd /home/tarnum/itemdb-green/ | |
git fetch origin main | |
git reset --hard FETCH_HEAD | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
yarn | |
yarn build || exit | |
pm2 stop ecosystem.config.js --only itemdb-green --update-env |