From 11f0877bc72834b25c1fe69d376b8b59d9b0b25c Mon Sep 17 00:00:00 2001 From: Jaclyn Taroni Date: Sun, 20 Dec 2020 10:26:39 -0500 Subject: [PATCH] GHA: Slack us if Docker build or rendering fails (#438) * Add Slack notification to docker-build-push.yml * Add Slack notification to docker-build.yml * Add branch for testing * Add library load of package not installed * Revert "Add library load of package not installed" This reverts commit 4e83ed1e104f0760db40752f9bc9e641f916d374. * Revert "Add branch for testing" This reverts commit 06073504426dc1903cf46bb99cc65a3a91894a3c. --- .github/workflows/docker-build-push.yml | 11 +++++++++++ .github/workflows/docker-build.yml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index b3832343..e334fa8f 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -91,3 +91,14 @@ jobs: git add -A git commit -m 'Render html and publish' || echo "No changes to commit" git push origin gh-pages || echo "No changes to push" + + # If we have a failure, Slack us + - name: Report failure to Slack + if: always() + uses: ravsamhq/notify-slack-action@v1.1 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} + SLACK_MESSAGE: 'Build, Render, and Push failed' diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index aa065d43..b2a84002 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -42,3 +42,14 @@ jobs: tags: ccdl/refinebio-examples:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache + + # If we have a failure, Slack us + - name: Report failure to Slack + if: always() + uses: ravsamhq/notify-slack-action@v1.1 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} + SLACK_MESSAGE: 'Build Docker failed'