From f5bbe4dea13c018f98e91edaf2da169e4655e794 Mon Sep 17 00:00:00 2001 From: Ryoichi Ando Date: Wed, 15 Jan 2025 17:14:45 +0900 Subject: [PATCH] add slack notify to two CI actions --- .github/workflows/build-docker.yml | 15 +++++++++++++++ .github/workflows/getting-started.yml | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 2540065..7f23afd 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -12,7 +12,9 @@ on: - base env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} REGISTRY: ghcr.io + jobs: build-image: runs-on: ubuntu-latest @@ -49,3 +51,16 @@ jobs: MODE=compiled IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-base:latest tags: ${{ env.REGISTRY }}/${{ github.repository }}-compiled:latest + + notify_failure: + runs-on: ${{ github.event.inputs.runner }} + needs: build-image + if: ${{ failure() }} + steps: + + - name: Slack Notification Failure + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_TITLE: Deploy / Failure + SLACK_COLOR: danger + SLACK_MESSAGE: One or more tests failed. \ No newline at end of file diff --git a/.github/workflows/getting-started.yml b/.github/workflows/getting-started.yml index 87854ec..ba1fdf5 100644 --- a/.github/workflows/getting-started.yml +++ b/.github/workflows/getting-started.yml @@ -8,6 +8,7 @@ on: workflow_dispatch: env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} DOCKER_IMAGE: nvidia/cuda:11.8.0-devel-ubuntu22.04 TMP_CONTAINER_NAME: tmp-ppf-dev TMP_ROOT: /root/ppf-contact-solver @@ -73,4 +74,17 @@ jobs: if: always() run: | docker stop $TMP_CONTAINER_NAME - docker rm $TMP_CONTAINER_NAME \ No newline at end of file + docker rm $TMP_CONTAINER_NAME + + notify_failure: + runs-on: ${{ github.event.inputs.runner }} + needs: headless + if: ${{ failure() }} + steps: + + - name: Slack Notification Failure + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_TITLE: Deploy / Failure + SLACK_COLOR: danger + SLACK_MESSAGE: One or more tests failed. \ No newline at end of file