feat: add notification for the workflow
All checks were successful
Blog Deployment / Check-Rebuild (push) Successful in 4s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 8s
Blog Deployment / Test-Staging (push) Successful in 2s
Blog Deployment / Merge (push) Successful in 5s
Blog Deployment / Deploy-Production (push) Successful in 8s
Blog Deployment / Test-Production (push) Successful in 1s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 2s

This commit is contained in:
2025-06-10 21:29:09 +00:00
parent bdd5002700
commit 20a9dfa633

View File

@@ -197,4 +197,32 @@ jobs:
- name: Remove Old Docker Image - name: Remove Old Docker Image
run: | run: |
docker image rm ${{ needs.Check-Rebuild.outputs.current_docker_image }} --force docker image rm ${{ needs.Check-Rebuild.outputs.current_docker_image }} --force
Notify:
needs: [Check-Rebuild, Build, Deploy-Staging, Test-Staging, Merge, Deploy-Production, Test-Production, Clean]
runs-on: ubuntu
if: always()
env:
NTFY_URL: https://ntfy.vezpi.me
NTFY_TOPIC: blog
NTFY_TOKEN: ${{ secrets.NTFY_CREDENTIALS }}
steps:
- name: Notify Workflow Result
run: |
if [ "${{ success() }}" == "true" ]; then
curl -H "Priority: min" \
-H "Tags: white_check_mark" \
-H "Actions: view, View Run "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
-d "Blog workflow completed successfully!" \
-u ${NTFY_TOKEN} \
${NTFY_URL}/${NTFY_TOPIC}
else
curl -H "Priority: high" \
-H "Tags: x" \
-H "Actions: view, View Run "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
-d "Blog workflow failed somewhere in the pipeline." \
-u ${NTFY_TOKEN} \
${NTFY_URL}/${NTFY_TOPIC}
fi