Skip to content

Commit 9981dec

Browse files
committed
[cicd] discord 에 알림이 오도록 수정
1 parent 5d4e0cb commit 9981dec

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

.github/workflows/discord-pr.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Discord PR Notification
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
notify_discord:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Discord Notification
15+
env:
16+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PR_WEBHOOK }}
17+
uses: Ilshidur/action-discord@master
18+
with:
19+
args: '새로운 PR이 열렸습니다! @이광훈 @배지훈 \nPR: ${{ github.event.pull_request.html_url }}\n작성자: ${{ github.event.pull_request.user.login }}\n제목: ${{ github.event.pull_request.title }}'

.github/workflows/main.yml

+27-5
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,40 @@ jobs:
77
build:
88
runs-on: ubuntu-20.04
99
steps:
10-
- name: Checkout source code.
10+
- name: Checkout source code
1111
uses: actions/checkout@v3
12-
12+
1313
- name: Install dependencies
1414
run: yarn install
15-
15+
1616
- name: Generate build
1717
run: yarn build
18-
19-
- name: Deploy
18+
19+
- name: Deploy to S3
20+
id: deploy
2021
env:
2122
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2223
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2324
run: |
2425
aws s3 sync --region ap-northeast-2 dist s3://alignlab-client --delete
26+
continue-on-error: true
27+
28+
- name: Discord notification - Success
29+
if: steps.deploy.outcome == 'success'
30+
env:
31+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
32+
uses: Ilshidur/action-discord@master
33+
with:
34+
args: "🎉 배포가 성공적으로 완료되었습니다! 브랜치: develop"
35+
36+
- name: Discord notification - Failure
37+
if: steps.deploy.outcome == 'failure'
38+
env:
39+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
40+
uses: Ilshidur/action-discord@master
41+
with:
42+
args: "❌ 배포 중 오류가 발생했습니다. 브랜치: develop"
43+
44+
- name: Check deploy result
45+
if: steps.deploy.outcome == 'failure'
46+
run: exit 1

0 commit comments

Comments
 (0)