alert-failed-dps-jobs #3665
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |