|
35 | 35 | USER_GIT_BRANCH: ${{ github.event.inputs.GIT_BRANCH }}
|
36 | 36 |
|
37 | 37 | 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 | + |
38 | 48 | rootfs-build:
|
39 | 49 | # only selected people can trigger this job
|
40 | 50 | if: contains('["nuclearcat","JenySadadia","a-wai","broonie","laura-nao","pawiecz","musamaanjum","nfraprado","crazoes"]', github.actor)
|
41 | 51 | runs-on: ubuntu-22.04
|
42 | 52 | environment: deploysecrets
|
43 | 53 | 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' |
54 | 54 | - name: Checkout kernelci-deploy
|
55 | 55 | uses: actions/checkout@v4
|
56 | 56 | with:
|
@@ -114,3 +114,26 @@ jobs:
|
114 | 114 | author_name: ${{ github.actor }}
|
115 | 115 | title: 'ROOTFS Build completed'
|
116 | 116 | 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