Skip to content

Commit 3f09053

Browse files
committed
workflows: Replace slack by discord notifications on rootfs workflows
Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent cdc7572 commit 3f09053

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

.github/workflows/rootfs.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ env:
3535
USER_GIT_BRANCH: ${{ github.event.inputs.GIT_BRANCH }}
3636

3737
jobs:
38+
discord-notify-start:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Discord notification for start
42+
env:
43+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
44+
uses: Ilshidur/action-discord@master
45+
with:
46+
args: 'Rootfs build started: "${{ github.event.inputs.ROOTFS_NAME }}" for architecture "${{ github.event.inputs.ROOTFS_ARCH }}" by ${{ github.actor }}'
47+
3848
rootfs-build:
3949
# only selected people can trigger this job
4050
if: contains('["nuclearcat","JenySadadia","a-wai","broonie","laura-nao","pawiecz","musamaanjum","nfraprado","crazoes"]', github.actor)
4151
runs-on: ubuntu-22.04
4252
environment: deploysecrets
4353
steps:
44-
- name: Slack notification
45-
uses: rtCamp/action-slack-notify@v2
46-
env:
47-
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
48-
SLACK_CHANNEL: 'bot'
49-
with:
50-
status: 'started'
51-
author_name: ${{ github.actor }}
52-
title: 'ROOTFS Build'
53-
text: 'ROOTFS Build started'
5454
- name: Checkout kernelci-deploy
5555
uses: actions/checkout@v4
5656
with:
@@ -114,3 +114,26 @@ jobs:
114114
author_name: ${{ github.actor }}
115115
title: 'ROOTFS Build completed'
116116
text: ${{ env.FINAL_MSG }}
117+
118+
discord-notify-end:
119+
runs-on: ubuntu-latest
120+
needs: rootfs-build
121+
steps:
122+
- name: Discord notification for end
123+
env:
124+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
125+
uses: Ilshidur/action-discord@master
126+
with:
127+
args: 'Rootfs build completed: "${{ github.event.inputs.ROOTFS_NAME }}" for architecture "${{ github.event.inputs.ROOTFS_ARCH }}". Check the logs for more details.'
128+
129+
discord-notify-failure:
130+
runs-on: ubuntu-latest
131+
if: failure()
132+
needs: [discord-notify-start, rootfs-build, discord-notify-end]
133+
steps:
134+
- name: Notify failure to Discord
135+
env:
136+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
137+
uses: Ilshidur/action-discord@master
138+
with:
139+
args: 'Rootfs build failed: "${{ github.event.inputs.ROOTFS_NAME }}" for architecture "${{ github.event.inputs.ROOTFS_ARCH }}". Check the logs for more details.'

0 commit comments

Comments
 (0)