-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) ยท 1.35 KB
/
cd.yml
File metadata and controls
50 lines (45 loc) ยท 1.35 KB
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
name: Auto Deployment
on:
push:
# prod, release ๋ธ๋์น์ push ์ ์๋
branches:
- prod
- release
jobs:
# push ์ ํ๊ฒ ๋ธ๋์น๊ฐ release ์ผ ๋ ์๋ํ๋ job
deploy_release:
if: contains(github.ref, 'release')
runs-on: ubuntu-latest
steps:
- name: sshAction
# with ์ ์ ๋ณด์ ํจ๊ป ์๊ฒฉ ์ ์ ์ํ
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RELEASE_HOST }}
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
script: |
cd chobab_release
git clean -fd
git checkout release
git pull origin release
sh script/client-deploy.sh
sh script/server-deploy.sh
# push ์ ํ๊ฒ ๋ธ๋์น๊ฐ main ์ผ ๋ ์๋ํ๋ job
deploy_prod:
if: contains(github.ref, 'prod')
runs-on: ubuntu-latest
steps:
- name: sshAction
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
password: ${{ secrets.PROD_PASSWORD }}
script: |
cd chobab
git clean -fd
git checkout prod
git pull origin prod
sh script/client-deploy.sh
sh script/server-deploy.sh