-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·36 lines (33 loc) · 1.48 KB
/
post-deploy-slack-notification.yml
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
name: Post Deploy
on:
workflow_run:
workflows: [Deploy CARTSv3]
types: [completed]
branches:
- 'main'
- 'val'
- 'production'
jobs:
notify_on_failure:
# Sends alert to macpro-mdct-<product name>-alerts channel in CMS slack when any integration environment fails to deploy or run tests
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'val' || github.event.workflow_run.head_branch == 'production') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":boom: The latest ${{ github.repository }} build on branch '${{ github.event.workflow_run.head_branch }}' has failed"
SLACK_MESSAGE: "${{ github.event.workflow_run.html_url }}"
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# Sends a slack message to the mdct-prod-releases channel in CMS slack
notify_on_prod_release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'production') }}
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":rocket: ${{ github.repository }} has successfully released to production."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.PROD_RELEASE_SLACK_WEBHOOK }}