notify ntfy on fail
All checks were successful
Apply Kuberentes Configs / update-repo (push) Successful in 0s
Apply Kuberentes Configs / update-infrastructure (push) Successful in 2s
Apply Kuberentes Configs / notify-on-failure (push) Has been skipped

This commit is contained in:
2026-02-18 20:24:02 -07:00
parent a12f1dd9fe
commit 659849a652
2 changed files with 47 additions and 1 deletions

View File

@@ -48,4 +48,17 @@ jobs:
- name: homepage - name: homepage
run: | run: |
kubectl apply -f kubernetes/homepage/ kubectl apply -f kubernetes/homepage/
kubectl rollout restart deployment/homepage -n homepage 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 }}

View File

@@ -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 }}"