From 8726ffeeddeab611502c72a65eed4a848b7a660c Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Fri, 10 Jan 2025 20:56:12 +0000 Subject: [PATCH] fix: c78e0499 (ntfy workflow) --- .github/workflows/ntfy.yaml | 51 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ntfy.yaml b/.github/workflows/ntfy.yaml index b0fbd3d..4aef1a9 100644 --- a/.github/workflows/ntfy.yaml +++ b/.github/workflows/ntfy.yaml @@ -1,21 +1,32 @@ -- name: Notify on Success - if: success() - run: | - curl \ - -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \ - -H "Title: blockmatic deployment succeeded" \ - -H "Priority: low" \ - -H "Tags: white_check_mark" \ - -d $'Commit: ${{ github.event.head_commit.message }}\nHash: ${{ github.sha }}' \ - ${{ secrets.NTFY_URL }} +name: Ntfy Deployment Notifications +on: + push: + branches: + - main -- name: Notify on Failure - if: failure() - run: | - curl \ - -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \ - -H "Title: blockmatic deployment failed" \ - -H "Priority: max" \ - -H "Tags: x" \ - -d $'Commit: ${{ github.event.head_commit.message }}\nHash: ${{ github.sha }}' \ - ${{ secrets.NTFY_URL }} +jobs: + notify: + if: failure() || success() + runs-on: ubuntu-latest + steps: + - name: Notify on Success + if: success() + run: | + curl \ + -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \ + -H "Title: blockmatic deployment succeeded" \ + -H "Priority: low" \ + -H "Tags: white_check_mark" \ + -d $'Commit: ${{ github.event.head_commit.message }}\nHash: ${{ github.sha }}' \ + ${{ secrets.NTFY_URL }} + + - name: Notify on Failure + if: failure() + run: | + curl \ + -H "Authorization: Bearer ${{ secrets.NTFY_TOKEN }}" \ + -H "Title: blockmatic deployment failed" \ + -H "Priority: max" \ + -H "Tags: x" \ + -d $'Commit: ${{ github.event.head_commit.message }}\nHash: ${{ github.sha }}' \ + ${{ secrets.NTFY_URL }}