Skip to content

Commit fcfa270

Browse files
authored
add: support for notifying the maintainers about the docker ci status. (huggingface#7113)
1 parent 56dac1c commit fcfa270

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/build_docker_images.yml

+25
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ concurrency:
1111

1212
env:
1313
REGISTRY: diffusers
14+
CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
1415

1516
jobs:
1617
build-docker-images:
@@ -50,3 +51,27 @@ jobs:
5051
context: ./docker/${{ matrix.image-name }}
5152
push: true
5253
tags: ${{ env.REGISTRY }}/${{ matrix.image-name }}:latest
54+
55+
- name: Post to a Slack channel
56+
id: slack
57+
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
58+
with:
59+
# Slack channel id, channel name, or user id to post message.
60+
# See also: https://api.slack.com/methods/chat.postMessage#channels
61+
channel-id: ${{ env.CI_SLACK_CHANNEL }}
62+
# For posting a rich message using Block Kit
63+
payload: |
64+
{
65+
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
66+
"blocks": [
67+
{
68+
"type": "section",
69+
"text": {
70+
"type": "mrkdwn",
71+
"text": "${{ matrix.image-name }} Docker Image build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
72+
}
73+
}
74+
]
75+
}
76+
env:
77+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)