-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (29 loc) · 1.06 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 --namespace witcher --name witcher-api