From d27616ed431db2fd9ec3f4039b6251f2444fee74 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Tue, 27 Jan 2026 18:46:02 +0100 Subject: [PATCH] deploy --- .gitea/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 57d393ce..bb09a2be 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -221,21 +221,32 @@ jobs: - name: 🔔 Gotify Notification (Success) if: success() run: | - curl -k -X POST "https://gotify.infra.mintel.me/message" \ - -H "X-Gotify-Key: ${{ secrets.GOTIFY_TOKEN }}" \ + echo "Sending success notification to Gotify..." + RESPONSE=$(curl -k -s -w "\n%{http_code}" -X POST "https://gotify.infra.mintel.me/message?token=${{ secrets.GOTIFY_TOKEN }}" \ -F "title=✅ Deployment Success: ${{ github.repository }}" \ -F "message=The deployment of ${{ github.repository }} (branch: ${{ github.ref }}) was successful. Commit: ${{ github.sha }} Actor: ${{ github.actor }} Run ID: ${{ github.run_id }}" \ - -F "priority=5" + -F "priority=5") + + HTTP_CODE=$(echo "$RESPONSE" | tail -n1) + BODY=$(echo "$RESPONSE" | sed '$d') + + echo "HTTP Status: $HTTP_CODE" + echo "Response Body: $BODY" + + if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then + echo "Failed to send Gotify notification" + exit 0 # Don't fail the workflow because of notification failure + fi - name: 🔔 Gotify Notification (Failure) if: failure() run: | - curl -k -X POST "https://gotify.infra.mintel.me/message" \ - -H "X-Gotify-Key: ${{ secrets.GOTIFY_TOKEN }}" \ + echo "Sending failure notification to Gotify..." + RESPONSE=$(curl -k -s -w "\n%{http_code}" -X POST "https://gotify.infra.mintel.me/message?token=${{ secrets.GOTIFY_TOKEN }}" \ -F "title=❌ Deployment Failed: ${{ github.repository }}" \ -F "message=The deployment of ${{ github.repository }} (branch: ${{ github.ref }}) failed! @@ -244,4 +255,15 @@ jobs: Run ID: ${{ github.run_id }} Please check the logs for details." \ - -F "priority=8" + -F "priority=8") + + HTTP_CODE=$(echo "$RESPONSE" | tail -n1) + BODY=$(echo "$RESPONSE" | sed '$d') + + echo "HTTP Status: $HTTP_CODE" + echo "Response Body: $BODY" + + if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then + echo "Failed to send Gotify notification" + exit 0 # Don't fail the workflow because of notification failure + fi