core(cd): rename app in workflow #3
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: Node.js CD - Production | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: appleboy/ssh-action@master | |
name: Deploy production on VPS | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
passphrase: ${{ secrets.SERVER_PASSPHRASE }} | |
port: 22 | |
script: | | |
export PATH="$PATH:/home/reginald/.nvm/versions/node/v16.16.0/bin/" | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
nvm use --lts | |
cd ~/dev/repos/w3-bestiary/w3-bestiary-back | |
git checkout main | |
git fetch --all | |
git reset --hard origin/main | |
yarn install | |
yarn build | |
pm2 delete witcher-api | |
pm2 start dist/src/main.js --name witcher-api |