29 lines
1.1 KiB
YAML
29 lines
1.1 KiB
YAML
name: Deployment Notifications
|
|
on: [deployment_status]
|
|
|
|
jobs:
|
|
notify:
|
|
if: github.event.deployment_status.state == "failure" | github.event.deployment_status.state == "success"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Notify on Success
|
|
if: github.event.deployment_status.state == "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: github.event.deployment_status.state == "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 }}
|