-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (34 loc) · 1.41 KB
/
notifications.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
name: Notifications
on: deployment_status
jobs:
notifications:
runs-on: ubuntu-latest
steps:
- name: Request Deployment Approval
uses: Ilshidur/action-discord@master
if: ${{ github.event.deployment_status.state == 'waiting' && github.event.deployment.environment == 'Production' }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"title": "[${{ github.repository }}] Requires Deployment Approval",
"url": "${{ github.event.deployment_status.target_url }}",
"description": "${{ github.repository }} requires approval for deployment to production.",
"color": 15105570
}
]
- name: Notify Deployment Success
uses: Ilshidur/action-discord@master
if: ${{ github.event.deployment_status.state == 'success' }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_EMBEDS: |
[
{
"title": "[${{ github.repository }}] ${{ github.event.deployment.environment }} Deployment Succeeded",
"url": "${{ github.event.deployment_status.target_url }}",
"description": "Successfully deployed ${{ github.repository }} to ${{ github.event.deployment.environment }}.",
"color": 3066993
}
]