-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (37 loc) · 1.1 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
name: GCP CI/CD
on:
pull_request:
types:
- closed
jobs:
if_merged:
runs-on: ubuntu-latest
steps:
- if: github.event.pull_request.merged == true && github.head_ref == 'feature/Backend'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
port: 22
script: |
cd ${{ secrets.PWD }}
git pull origin main
cd ${{ secrets.PWD }}/BackendJS/BackendTS
npm install
pm2 reload Traffic --time
- if: github.event.pull_request.merged == true && github.head_ref == 'Frontend'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
port: 22
script: |
cd ${{ secrets.PWD }}
git pull origin main
cd ${{ secrets.PWD }}/Backend/Frontend/creative
npm install
npm run build