diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67f9b22..16d2f69 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,3 +82,40 @@ jobs: - name: Push Manifests run: | DISTS="buster bullseye latest" bash pushmanifest + + # If the CI Pipeline does not succeed we should notify the interested agents + slack-notif: + runs-on: ubuntu-22.04 + needs: + - build_multiarch + - deploy_manifests + if: always() + name: Notify unsuccessful CI run + steps: + - name: Notify in Slack channel + if: ${{ needs.build_multiarch.result == 'failure' || needs.deploy_manifests.result == 'failure' }} + uses: slackapi/slack-github-action@v1.23.0 + with: + payload: | + { + "text": "*Unsuccessful `bitnami/minideb` CI pipeline*", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Unsuccessful `bitnami/minideb` CI pipeline*" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "The CI pipeline for `bitnami/minideb` did not succeed. Check the related <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|action run> for more information." + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK