Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add mattermost notification to docker action
authorAugustin Degomme <adegomme@gmail.com>
Mon, 30 Aug 2021 16:09:28 +0000 (16:09 +0000)
committerAugustin Degomme <adegomme@gmail.com>
Mon, 30 Aug 2021 16:09:28 +0000 (16:09 +0000)
.github/workflows/docker.yml

index a1ae034..7e5e2e2 100644 (file)
@@ -36,3 +36,16 @@ jobs:
           make stable
           make all
           make push
+      - name: Create the failure Message
+        if: ${{ failure() }}
+        run: |
+          echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building docker images ! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+      - name: Create the success Message
+        if: ${{ success() }}
+        run: |
+          echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker images built and pushed successfully ! You can get it on: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+      - uses: mattermost/action-mattermost-notify@master
+        env:
+          MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
+          MATTERMOST_CHANNEL: ${{ secrets.MATTERMOST_CHANNEL}}
+