diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index daf38f6..edf79f9 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -22,6 +22,20 @@ steps: --label "git.branch=${CI_COMMIT_BRANCH}" \ . + - name: Send Build Status Notification (failure) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Docker image build + when: + - status: [ failure ] + - name: Push to registry image: docker:latest environment: @@ -52,6 +66,8 @@ steps: - | BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Push to registry when: - status: [ success ] @@ -64,5 +80,7 @@ steps: - | BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Push to registry when: - status: [ failure ]