File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1919 uses : ./.github/workflows/reusable_build_image.yaml
2020 secrets :
2121 harbor-robot-secret : ${{ secrets.HARBOR_ROBOT_DEMOS_GITHUB_ACTION_BUILD_SECRET }}
22+ slack-token : ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
2223 with :
2324 image-name : jupyter-pyspark-with-alibi-detect
2425 # TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
Original file line number Diff line number Diff line change 1818 uses : ./.github/workflows/reusable_build_image.yaml
1919 secrets :
2020 harbor-robot-secret : ${{ secrets.HARBOR_ROBOT_DEMOS_GITHUB_ACTION_BUILD_SECRET }}
21+ slack-token : ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
2122 with :
2223 image-name : nifi
2324 # TODO (@NickLarsenNZ): Use a versioned image with stackable0.0.0-dev or stackableXX.X.X so that
Original file line number Diff line number Diff line change 1414 harbor-robot-secret :
1515 description : The secret for the Harbor robot user used to push images and manifest
1616 required : true
17+ slack-token :
18+ description : The Slack token used to post failure notifications
19+ required : true
1720
1821jobs :
1922 build :
7982 image-registry-password : ${{ secrets.harbor-robot-secret }}
8083 image-repository : demos/${{ env.IMAGE_NAME }}
8184 image-index-manifest-tag : ${{ env.IMAGE_VERSION }}
85+
86+ notify :
87+ name : Failure Notification
88+ needs : [build, publish_manifests]
89+ runs-on : ubuntu-latest
90+ if : failure()
91+ steps :
92+ - uses : slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
93+ with :
94+ channel-id : " C07UG6JH44F" # notifications-container-images
95+ payload : |
96+ {
97+ "text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
98+ "attachments": [
99+ {
100+ "pretext": "See the details below for a summary of which job(s) failed.",
101+ "color": "#aa0000",
102+ "fields": [
103+ {
104+ "title": "Build/Publish Image",
105+ "short": true,
106+ "value": "${{ needs.build.result }}"
107+ },
108+ {
109+ "title": "Build/Publish Manifests",
110+ "short": true,
111+ "value": "${{ needs.publish_manifests.result }}"
112+ }
113+ ],
114+ "actions": [
115+ {
116+ "type": "button",
117+ "text": "Go to workflow run",
118+ "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
119+ }
120+ ]
121+ }
122+ ]
123+ }
124+ env :
125+ SLACK_BOT_TOKEN : ${{ secrets.slack-token }}
You can’t perform that action at this time.
0 commit comments