From c769da5f26af4da6eea8367c24ee80d9230918c4 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 25 Feb 2026 03:04:47 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20granular=20Gotify=20notification=20prio?= =?UTF-8?q?rities=20=E2=80=94=20critical(10)=20for=20deploy=20fail,=20high?= =?UTF-8?q?(8)=20for=20smoke=20fail,=20normal(5)=20for=20perf=20issues,=20?= =?UTF-8?q?quiet(2)=20for=20success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy.yml | 40 ++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 5d59100c..a7fc2d38 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -561,12 +561,42 @@ jobs: steps: - name: 🔔 Gotify run: | - STATUS="${{ needs.deploy.result }}" + DEPLOY="${{ needs.deploy.result }}" SMOKE="${{ needs.post_deploy_checks.result }}" - TITLE="klz-cables.com: deploy=$STATUS smoke=$SMOKE" - [[ "$STATUS" == "success" && "$SMOKE" == "success" ]] && PRIORITY=5 || PRIORITY=8 - + PERF="${{ needs.performance.result }}" + TARGET="${{ needs.prepare.outputs.target }}" + VERSION="${{ needs.prepare.outputs.image_tag }}" + URL="${{ needs.prepare.outputs.next_public_url }}" + + # Gotify priority scale: + # 1-3 = low (silent/info) + # 4-5 = normal + # 6-7 = high (warning) + # 8-10 = critical (alarm) + if [[ "$DEPLOY" != "success" ]]; then + PRIORITY=10 + EMOJI="🚨" + STATUS_LINE="DEPLOY FAILED" + elif [[ "$SMOKE" != "success" ]]; then + PRIORITY=8 + EMOJI="⚠️" + STATUS_LINE="Smoke tests failed" + elif [[ "$PERF" != "success" ]]; then + PRIORITY=5 + EMOJI="📉" + STATUS_LINE="Performance degraded" + else + PRIORITY=2 + EMOJI="✅" + STATUS_LINE="All checks passed" + fi + + TITLE="$EMOJI klz-cables.com $VERSION → $TARGET" + MESSAGE="$STATUS_LINE + Deploy: $DEPLOY | Smoke: $SMOKE | Perf: $PERF + $URL" + curl -s -k -X POST "${{ secrets.GOTIFY_URL }}/message?token=${{ secrets.GOTIFY_TOKEN }}" \ -F "title=$TITLE" \ - -F "message=Deploy to ${{ needs.prepare.outputs.target }} finished.\nDeploy: $STATUS | Smoke: $SMOKE\nVersion: ${{ needs.prepare.outputs.image_tag }}" \ + -F "message=$MESSAGE" \ -F "priority=$PRIORITY" || true