-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (42 loc) · 1.56 KB
/
schedule-alert-failed-dps-jobs.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: alert-failed-dps-jobs
on:
workflow_dispatch:
schedule:
# every hour
- cron: '0 * * * *'
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- name: checkout
uses: actions/checkout@v2
- name: python setup
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: get docker GID and set DOCKER_GID environment variable
run: |
echo "DOCKER_GID=$(getent group docker | cut -d: -f3)" >> $GITHUB_ENV
- name: get current user UID and set UID environment variable
run: |
echo "UID=$(id -u)" >> $GITHUB_ENV
- name: print DOCKER_GID and UID
run: |
echo "Docker GID: $DOCKER_GID"
echo "User UID: $UID"
- name: filter DPS failed jobs and alert
uses: Earth-Information-System/fireatlas/.github/actions/alert-on-failed-dps-jobs@conus-dps
with:
maap_pgt_secret: ${{ secrets.MAAP_PGT }}
email_pw_secret: ${{ secrets.EMAIL_PW }}
- name: send alert on Slack if failure
if: always()
uses: ravsamhq/[email protected]
with:
status: ${{ job.status }}
notify_when: 'failure'
notification_title: "DPS Job Failed - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}|View Failed Run>"
footer: "<${{github.server_url}}/${{github.repository}}/issues/|Open GitHub Issues>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK_WEBHOOK_URL }}