-
Notifications
You must be signed in to change notification settings - Fork 8
52 lines (45 loc) ยท 1.32 KB
/
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
43
44
45
46
47
48
49
50
51
52
name: Deploy
on:
pull_request:
types: [closed]
branches: [main]
jobs:
deploy_1:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
strategy:
matrix:
node-version: [14.x]
steps:
- name: server deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_SERVER }}
username: ${{ secrets.SSH_USERNAME_SERVER }}
password: ${{ secrets.SSH_PWD_SERVER }}
port: ${{ secrets.SSH_PORT_SERVER }}
script: |
cd ${{ secrets.SSH_REPOSITORY_SERVER }}
git fetch origin main && git reset --hard origin/main
yarn install
pm2 kill
yarn run deploy
deploy_2:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
strategy:
matrix:
node-version: [16.x]
steps:
- name: client deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_CLIENT }}
username: ${{ secrets.SSH_USERNAME_CLIENT }}
password: ${{ secrets.SSH_PWD_CLIENT }}
port: ${{ secrets.SSH_PORT_CLIENT }}
script: |
cd ${{ secrets.SSH_REPOSITORY_CLIENT }}
git fetch origin main && git reset --hard origin/main
yarn install
yarn build