From 659849a652442008d7e537a03f15f0980da0c8bb Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Wed, 18 Feb 2026 20:24:02 -0700 Subject: [PATCH] notify ntfy on fail --- .gitea/workflows/apply-kubernetes.yml | 15 +++++++++++- .gitea/workflows/notify-ntfy.yml | 33 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/notify-ntfy.yml diff --git a/.gitea/workflows/apply-kubernetes.yml b/.gitea/workflows/apply-kubernetes.yml index cd06808..0104378 100644 --- a/.gitea/workflows/apply-kubernetes.yml +++ b/.gitea/workflows/apply-kubernetes.yml @@ -48,4 +48,17 @@ jobs: - name: homepage run: | kubectl apply -f kubernetes/homepage/ - kubectl rollout restart deployment/homepage -n homepage \ No newline at end of file + kubectl rollout restart deployment/homepage -n homepage + + notify-on-failure: + runs-on: home-server + needs: update-infrastructure + if: failure() + uses: ./.gitea/workflows/notify-ntfy.yml + with: + title: "Kubernetes Apply Failed" + message: "Failed to apply kubernetes configs in ${{ gitea.repository }} - Run: ${{ gitea.run_number }}" + priority: "high" + tags: "rotating_light,kubernetes" + secrets: + NTFY_CHANNEL: ${{ secrets.NTFY_CHANNEL }} \ No newline at end of file diff --git a/.gitea/workflows/notify-ntfy.yml b/.gitea/workflows/notify-ntfy.yml new file mode 100644 index 0000000..cafb619 --- /dev/null +++ b/.gitea/workflows/notify-ntfy.yml @@ -0,0 +1,33 @@ +name: Notify NTFY +on: + workflow_call: + inputs: + title: + required: true + type: string + message: + required: true + type: string + priority: + required: false + type: string + default: "default" + tags: + required: false + type: string + default: "warning" + secrets: + NTFY_CHANNEL: + required: true + +jobs: + send-notification: + runs-on: home-server + steps: + - name: Send ntfy notification + run: | + curl -H "Title: ${{ inputs.title }}" \ + -H "Priority: ${{ inputs.priority }}" \ + -H "Tags: ${{ inputs.tags }}" \ + -d "${{ inputs.message }}" \ + "https://ntfy.sh/${{ secrets.NTFY_CHANNEL }}"