-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (38 loc) · 1.07 KB
/
api-deploy.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
33
34
35
36
37
38
39
40
41
42
name: Transport API deploy
on:
push:
branches:
- main
paths-ignore:
- README.md
- .gitignore
- client/**
jobs:
deploy:
name: Build
runs-on: ubuntu-20.04
steps:
- name: deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.API_SERVER_HOST }}
username: ${{ secrets.API_SERVER_USERNAME }}
password: ${{ secrets.API_SERVER_PASSWORD }}
script: |
cd ${{ secrets.API_SERVER_FOLDER }}
git checkout main
git fetch
git reset --hard origin/main
git clean -df
git pull
# Fix NVM appleboy/ssh-action
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
nvm use
export APP_PORT=${{ secrets.API_SERVER_PORT }}
export NODE_ENV=production
pnpm -r --filter transport-server --filter transport-common i
pnpm build:common
pnpm build:server
pm2 delete transport-server
pm2 start --name transport-server pnpm -- start:server