-
Notifications
You must be signed in to change notification settings - Fork 1
204 lines (196 loc) · 6.75 KB
/
dev-deploy.yaml
File metadata and controls
204 lines (196 loc) · 6.75 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: 🧑💻 개발 환경 React App CI/CD
on:
push:
branches:
- dev
env:
ENVIRONMENT: dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
####################################################################################################
# APPLY MODULE
####################################################################################################
- name: Apply 모듈 배포 스크립트 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SSH_HOST }}
username: ${{ secrets.DEV_SSH_USERNAME }}
password: ${{ secrets.DEV_SSH_PASSWORD }}
port: ${{ secrets.DEV_SSH_PORT }}
script: |
cd ~/jnu-parking/Parking-Ticket-FE
git stash
git checkout dev
git pull origin dev
pnpm install --frozen-lockfile --strict-peer-dependencies --ignore-scripts
pnpm build:apply
pm2 restart apply
- name: Apply 모듈 Slack 성공 알림
if: success()
uses: 8398a7/action-slack@v3
with:
status: custom
fields: author, workflowRun, pullRequest
custom_payload: |
{
attachments: [{
color: '#50CAF1',
title: `🏃♂️➡️ 개발 환경 Apply 모듈 CICD 진행 완료!`,
fields: [
{
title: '배포 환경',
value: `${process.env.ENVIRONMENT}`,
short: true,
},
{
title: '배포자',
value: `${process.env.AS_AUTHOR}`,
short: true,
},
{
title: '워크플로 링크',
value: `${process.env.AS_WORKFLOW_RUN}`,
short: true,
},
{
title: 'PR 링크',
value: `${process.env.AS_PULL_REQUEST}`,
short: true,
}
]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }}
- name: Apply 모듈 Slack 실패 알림
if: failure()
uses: 8398a7/action-slack@v3
with:
status: custom
fields: author, workflowRun, pullRequest
custom_payload: |
{
attachments: [{
color: '#CA0025',
title: `🧎♂️➡️ 개발 환경 Apply 모듈 CICD 진행 실패!`,
fields: [
{
title: '배포 환경',
value: `${process.env.ENVIRONMENT}`,
short: true,
},
{
title: '배포자',
value: `${process.env.AS_AUTHOR}`,
short: true,
},
{
title: '워크플로 링크',
value: `${process.env.AS_WORKFLOW_RUN}`,
short: true,
},
{
title: 'PR 링크',
value: `${process.env.AS_PULL_REQUEST}`,
short: true,
}
]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }}
####################################################################################################
# MANAGER MODULE
####################################################################################################
- name: Manager 모듈 배포 스크립트 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SSH_HOST }}
username: ${{ secrets.DEV_SSH_USERNAME }}
password: ${{ secrets.DEV_SSH_PASSWORD }}
port: ${{ secrets.DEV_SSH_PORT }}
script: |
cd ~/jnu-parking/Parking-Ticket-FE
git stash
git checkout dev
git pull origin dev
pnpm install --frozen-lockfile --strict-peer-dependencies --ignore-scripts
pnpm build:manager
pm2 restart manager
- name: Manager 모듈 Slack 성공 알림
if: success()
uses: 8398a7/action-slack@v3
with:
status: custom
fields: author, workflowRun, pullRequest
custom_payload: |
{
attachments: [{
color: '#50CAF1',
title: `🏃♂️➡️ 개발 환경 Manager 모듈 CICD 진행 완료!`,
fields: [
{
title: '배포 환경',
value: `${process.env.ENVIRONMENT}`,
short: true,
},
{
title: '배포자',
value: `${process.env.AS_AUTHOR}`,
short: true,
},
{
title: '워크플로 링크',
value: `${process.env.AS_WORKFLOW_RUN}`,
short: true,
},
{
title: 'PR 링크',
value: `${process.env.AS_PULL_REQUEST}`,
short: true,
}
]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }}
- name: Manager 모듈 Slack 실패 알림
if: failure()
uses: 8398a7/action-slack@v3
with:
status: custom
fields: author, workflowRun, pullRequest
custom_payload: |
{
attachments: [{
color: '#CA0025',
title: `🧎♂️➡️ 개발 환경 Manager 모듈 CICD 진행 실패!`,
fields: [
{
title: '배포 환경',
value: `${process.env.ENVIRONMENT}`,
short: true,
},
{
title: '배포자',
value: `${process.env.AS_AUTHOR}`,
short: true,
},
{
title: '워크플로 링크',
value: `${process.env.AS_WORKFLOW_RUN}`,
short: true,
},
{
title: 'PR 링크',
value: `${process.env.AS_PULL_REQUEST}`,
short: true,
}
]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }}