Skip to content

Commit 306d0bd

Browse files
committed
Update: Slack 알림 액션 변경
1 parent b798162 commit 306d0bd

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/deploy.yml

+41
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
actions: read
910

1011
jobs:
1112
build-docker-image:
@@ -46,6 +47,15 @@ jobs:
4647
platforms: linux/amd64
4748
tags: ${{ secrets.KC_REGISTRY_URL }}/${{ secrets.IMAGE_NAME }}:${{ github.event.release.tag_name }}, ${{ secrets.KC_REGISTRY_URL }}/${{ secrets.IMAGE_NAME }}:latest
4849

50+
- name: slack-notification
51+
uses: 8398a7/action-slack@v3
52+
with:
53+
status: ${{ job.status }}
54+
fields: repo,action,ref,job,took
55+
env:
56+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
57+
if: failure()
58+
4959
update-k8s:
5060
needs: build-docker-image
5161
runs-on: ubuntu-latest
@@ -73,3 +83,34 @@ jobs:
7383
git add ./backend/${{ env.DIRECTORY_NAME }}/${{ env.REPO_NAME }}-deployment.yaml
7484
git commit -m "update: 이미지 버전 수정 ${{ secrets.IMAGE_NAME }} v${{ github.event.release.tag_name }} by Git Action"
7585
git push
86+
87+
- name: slack-notification
88+
uses: 8398a7/action-slack@v3
89+
with:
90+
status: ${{ job.status }}
91+
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
92+
env:
93+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
94+
if: failure()
95+
96+
- name: slack-notification
97+
uses: 8398a7/action-slack@v3
98+
with:
99+
status: ${{ job.status }}
100+
fields: repo,action,ref,job,took
101+
env:
102+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
103+
if: failure()
104+
105+
slack-notification:
106+
needs: [build-docker-image, update-k8s]
107+
runs-on: ubuntu-latest
108+
steps:
109+
- name: slack-notification
110+
uses: 8398a7/action-slack@v3
111+
with:
112+
status: ${{ job.status }}
113+
fields: repo,action,ref
114+
env:
115+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
116+
if: always()

0 commit comments

Comments
 (0)