-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (51 loc) · 1.38 KB
/
main.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
53
54
55
name: GCP CI/CD
on:
pull_request:
types:
- closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
#passphrase: ${{ secrets.PASSPHRASE }}
port: 22
script: pwd
- name: npm install
run: |
pwd
cd ${{ secrets.PWD }}
git pull origin main
# Frontend Merge 시 React 빌드
- name: React build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
#passphrase: ${{ secrets.PASSPHRASE }}
port: 22
if: github.head_ref == 'Frontend'
run: |
cd ${{ secrets.PWD }}/Backend/Frontend/creative
pm2 stop Traffic
npm install
npm run build
# Merge 하는 경우 서버 재시작
- name: server restart
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
#passphrase: ${{ secrets.PASSPHRASE }}
port: 22
run: |
cd ${{ secrets.PWD }}/BackendJS/BackendTS
npm install
pm2 restart Traffic