Skip to content

Commit 8cf41a4

Browse files
committed
add slack notifications
1 parent 6d25856 commit 8cf41a4

File tree

1 file changed

+27
-1
lines changed
  • adminforth/documentation/blog/2025-02-19-compose-ec2-deployment-ci-registry

1 file changed

+27
-1
lines changed

adminforth/documentation/blog/2025-02-19-compose-ec2-deployment-ci-registry/index.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,4 +803,30 @@ sudo growpart /dev/nvme0n1 1
803803
sudo resize2fs /dev/nvme0n1p1
804804
```
805805

806-
This will extend partition to the full disk size. No reboot is needed.
806+
This will extend partition to the full disk size. No reboot is needed.
807+
808+
809+
### Want slack notifications about build?
810+
811+
Create Slack channel and add [Slack app](https://slack.com/apps/A0F7YS25R-incoming-webhooks) to it.
812+
813+
Then create webhook URL and add it to GitHub secrets as `SLACK_WEBHOOK_URL`.
814+
815+
Add this steps to the end of your GitHub actions file:
816+
817+
```yml title=".github/workflows/deploy.yml"
818+
- name: Notify Slack on success
819+
if: success()
820+
run: |
821+
curl -X POST -H 'Content-type: application/json' --data \
822+
"{\"text\": \"✅ *${{ github.actor }}* successfully built *${{ github.ref_name }}* with commit \\\"${{ github.event.head_commit.message }}\\\".\n:link: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build> | :link: <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|View Commit>\"}" \
823+
${{ secrets.SLACK_WEBHOOK_URL }}
824+
825+
- name: Notify Slack on failure
826+
if: failure()
827+
run: |
828+
curl -X POST -H 'Content-type: application/json' --data \
829+
"{\"text\": \"❌ *${{ github.actor }}* failed to build *${{ github.ref_name }}* with commit \\\"${{ github.event.head_commit.message }}\\\".\n:link: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Build> | :link: <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|View Commit>\"}" \
830+
${{ secrets.SLACK_WEBHOOK_URL }}
831+
832+
```

0 commit comments

Comments
 (0)