Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Add Slack notification for image build workflow failure
Browse files Browse the repository at this point in the history
Signed-off-by: NymanRobin <[email protected]>
  • Loading branch information
NymanRobin committed May 29, 2024
1 parent 5b23bcf commit b63781a
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/build-images-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build-images-action
on:
push:
branches:
- 'main'
- 'main'
permissions: {}
jobs:
build:
Expand All @@ -12,15 +12,25 @@ jobs:
permissions:
contents: read
steps:
- name: build ironic-client image
uses: toptal/jenkins-job-trigger-action@137fff703dd260b52b53d3ba1960396415abc568 # 1.0.2
with:
jenkins_url: "https://jenkins.nordix.org/"
jenkins_user: "[email protected]"
jenkins_token: ${{ secrets.JENKINS_TOKEN }}
job_name: "metal3_ironic-client_container_image_building"
job_params: |
{
"BUILD_CONTAINER_IMAGE_GIT_REFERENCE": "${{ github.ref }}"
}
job_timeout: "1000"
- name: build ironic-client image
uses: toptal/jenkins-job-trigger-action@137fff703dd260b52b53d3ba1960396415abc568 # 1.0.2
with:
jenkins_url: "https://jenkins.nordix.org/"
jenkins_user: "[email protected]"
jenkins_token: ${{ secrets.JENKINS_TOKEN }}
job_name: "metal3_ironic-client_container_image_building"
job_params: |
{
"BUILD_CONTAINER_IMAGE_GIT_REFERENCE": "${{ github.ref }}"
}
job_timeout: "1000"
- name: Slack Notification on Failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # 2.3.0
env:
SLACK_TITLE: 'GitHub Action Failed in ${{ github.repository }}'
SLACK_COLOR: '#FF0000'
SLACK_MESSAGE: 'The GitHub Action workflow failed for ironic client image build.'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: metal3-github-actions-notify
SLACK_USERNAME: metal3-github-actions-notify

0 comments on commit b63781a

Please sign in to comment.