Skip to content

Commit 5406e83

Browse files
committed
Add notification for CD pipeline
1 parent 3bbe795 commit 5406e83

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/deploymentCd.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,10 @@ jobs:
4848
4949
- name: Apply Kubernetes manifests
5050
run: |
51-
kubectl apply -f resources.yaml
51+
kubectl apply -f resources.yaml
52+
53+
notifications:
54+
needs: deploy
55+
uses: ./.github/workflows/notifyCD.yaml
56+
secrets:
57+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL}}

.github/workflows/notifyCD.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Send Slack Notification for Video Service
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
SLACK_WEBHOOK_URL:
7+
required: true
8+
9+
jobs:
10+
success_notifier:
11+
if: success()
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Send success notification on Slack
15+
uses: slackapi/[email protected]
16+
with:
17+
payload: |
18+
{
19+
"text": "The Continuous Deployment for Video Service workflow has completed successfully."
20+
}
21+
env:
22+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
23+
24+
failure_notifier:
25+
if: failure()
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Send failure notification on Slack
29+
uses: slackapi/[email protected]
30+
with:
31+
payload: |
32+
{
33+
"text": "The Continuous Deployment for Video Service workflow has failed."
34+
}
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)