Skip to content

Commit 372c814

Browse files
julianknutsenclaude
andcommitted
feat: add Discord notification on production deploy
Sends an embed to Discord with commit info whenever the production branch is updated. Webhook URL stored in DISCORD_WEBHOOK_URL secret. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 69ece8f commit 372c814

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Notification
2+
3+
on:
4+
push:
5+
branches: [production]
6+
7+
jobs:
8+
notify:
9+
name: Discord Notification
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 2
15+
16+
- name: Get commit info
17+
id: info
18+
run: |
19+
echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
20+
echo "message=$(git log -1 --pretty=%s)" >> "$GITHUB_OUTPUT"
21+
echo "author=$(git log -1 --pretty=%an)" >> "$GITHUB_OUTPUT"
22+
23+
- name: Notify Discord
24+
env:
25+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
26+
run: |
27+
curl -fsSL -H "Content-Type: application/json" -d "{
28+
\"embeds\": [{
29+
\"title\": \"Wasteland deployed to production\",
30+
\"description\": \"\`${{ steps.info.outputs.short_sha }}\` ${{ steps.info.outputs.message }}\",
31+
\"color\": 5025616,
32+
\"fields\": [
33+
{\"name\": \"Author\", \"value\": \"${{ steps.info.outputs.author }}\", \"inline\": true},
34+
{\"name\": \"Branch\", \"value\": \"production\", \"inline\": true}
35+
],
36+
\"url\": \"https://github.com/${{ github.repository }}/commit/${{ github.sha }}\"
37+
}]
38+
}" "$DISCORD_WEBHOOK"

0 commit comments

Comments
 (0)