-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.11 KB
/
Deploy_dev.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
name: Deploy Dev
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout to repo
uses: actions/checkout@v4
- name: Copy files to VPS
uses: appleboy/scp-action@v0.1.0
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: './*'
target: '/root/apps/challengelogger/server'
- name: Run command to restart the app
uses: appleboy/ssh-action@v0.1.0
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
cd /root/apps/challengelogger/server
nvm install
corepack enable
yarn install --frozen-lockfile
yarn build
yarn generateSwaggerDocs
yarn db:migrate
pm2 restart /root/apps/challengelogger/ecosystem.config.js