diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index f80cdb8..2255877 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -197,4 +197,32 @@ jobs: - name: Remove Old Docker Image run: | 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 + \ No newline at end of file