Skip to content

Summary of Changes: Discord Webhooks & Commit Tracking โ€‹

Date: January 14, 2026
Status: โœ… Complete

Overview โ€‹

Implemented three major improvements to the CI/CD pipeline:

  1. Separate Discord webhooks for commits vs. deployments
  2. Automatic commit tracking & recovery for missed Discord notifications
  3. Updated documentation with setup and troubleshooting guides

1. Separate Discord Webhook Channels โ€‹

What Changed โ€‹

Old setup (single webhook):

DISCORD_WEBHOOK_URL โ†’ All notifications (commits + deployments)

New setup (separated):

DISCORD_WEBHOOK_COMMITS     โ†’ #commits (all code pushes)
DISCORD_WEBHOOK_DEV_DEPLOY  โ†’ #deployments (dev.ourlantern.app)
DISCORD_WEBHOOK_PROD_DEPLOY โ†’ #deployments (ourlantern.app)

Benefits โ€‹

  • โœ… Less noise in deployment channel (only successes/failures shown)
  • โœ… Audit trail of all commits in separate channel
  • โœ… Easier to track what's deployed vs. what's committed
  • โœ… Can mute one channel without missing important alerts

Files Modified โ€‹

GitHub Secrets to Add โ€‹

  1. Go to Settings โ†’ Secrets and variables โ†’ Actions
  2. Add these secrets (copy webhook URLs from Discord):
    • DISCORD_WEBHOOK_COMMITS
    • DISCORD_WEBHOOK_DEV_DEPLOY
    • DISCORD_WEBHOOK_PROD_DEPLOY
  3. Delete the old DISCORD_WEBHOOK_URL secret (deprecated)

2. Automatic Commit Tracking & Missed Notification Recovery โ€‹

The Problem (Solved) โ€‹

If Discord API was down or webhook was invalid:

  • โŒ Commit notification failed to post
  • โŒ Next push only showed new commits, not the failed one
  • โŒ Commit history became incomplete in Discord

The Solution โ€‹

New automatic recovery system:

  1. Each successful Discord notification is recorded in .github/.discord-posted-commits
  2. Before posting new commits, the workflow checks for missed ones
  3. If missed commits are found, they're automatically included in next notification
  4. Notification includes note: "โš ๏ธ Note: Includes N previously missed commit(s)"

Example scenario:

Commit A (notification fails) โ†’ Recorded as failed
Commit B (notification succeeds) โ†’ Pushed, includes A + B with note
User sees both A and B in Discord โœ…

How It Works โ€‹

Workflow:

  1. Checkout code with 50-commit history
  2. Check for previously missed Discord notifications - compare against posted list
  3. Prepare commit messages - include any missed commits
  4. Send Discord notification - includes missed + new commits
  5. Track posted commits - record successful posts to .github/.discord-posted-commits
  6. Upload posted commits log - save to artifacts for verification

Files Modified โ€‹

Testing the Recovery โ€‹

  1. Create two commits: A and B
  2. Push commit A (notification fails - simulate by breaking webhook URL)
  3. Revert webhook URL
  4. Push commit B
  5. Check Discord - should see both A and B with note about missed commit

3. Documentation Updates โ€‹

New Documentation โ€‹

docs/engineering/deployment/DISCORD_WEBHOOK_SETUP.md

  • Complete guide to creating Discord webhooks
  • Step-by-step setup instructions
  • Troubleshooting section
  • Testing webhook URLs manually

Updated Documentation โ€‹

docs/engineering/deployment/CICD_GUIDE.md

  • Updated Discord Notification workflow description
  • Added missed commit recovery explanation
  • Updated troubleshooting section with new webhook names
  • Link to DISCORD_WEBHOOK_SETUP.md

docs/engineering/deployment/BRANCH_PROTECTION_SETUP.md

  • Updated secrets list to use new webhook names
  • Link to DISCORD_WEBHOOK_SETUP.md

Next Steps (For You) โ€‹

1. Create Discord Webhooks โ€‹

  1. Go to your Discord server
  2. Create/use #commits and #deployments channels
  3. For each channel:
    • Settings โ†’ Integrations โ†’ Webhooks
    • New Webhook
    • Copy URL
    • Save to GitHub secrets

2. Add GitHub Secrets โ€‹

  1. Go to repo Settings โ†’ Secrets and variables โ†’ Actions
  2. Add:
    • DISCORD_WEBHOOK_COMMITS (from #commits webhook)
    • DISCORD_WEBHOOK_DEV_DEPLOY (from #deployments webhook)
    • DISCORD_WEBHOOK_PROD_DEPLOY (from #deployments webhook, can be same as dev)
  3. Delete old DISCORD_WEBHOOK_URL when confirmed working

3. Test the Setup โ€‹

  1. Push a test commit to dev branch
  2. Check:
    • #commits channel shows commit notification โœ…
    • Next push to dev shows deployment notification in #deployments โœ…
  3. Test missed commit recovery:
    • Temporarily break webhook URL
    • Push a commit (fails)
    • Fix webhook URL
    • Push another commit (should show both)

4. Update Documentation (Team) โ€‹

  • [ ] Document which channels are used for what
  • [ ] Document who has access to what channels
  • [ ] Add channel-specific notification rules if needed

Answers to Your Original Questions โ€‹

1. Environment Variables & Secrets โ€‹

โœ… Answered: Each secret is added individually (e.g., VITE_FIREBASE_API_KEY_DEV). Values are copied from platform-specific dashboards (Cloudflare, Firebase, Discord) into GitHub Actions secrets.

2. CODECOV_TOKEN โ€‹

โœ… Answered: Optional code coverage reporting service. Currently non-blocking in your CI. Can skip or implement later.

3. Discord Channels โ€‹

โœ… Implemented: Created separate webhooks for #commits and #deployments with setup guide.

4. Commit History on Failed Deployments โ€‹

โœ… Implemented: Automatic tracking and retry system for missed Discord notifications. Next push automatically includes previous failed commits.


Files Changed Summary โ€‹

Modified:
  .github/workflows/discord-notify.yml      โ† Added tracking & recovery
  .github/workflows/deploy-dev.yml          โ† New webhook name
  .github/workflows/deploy-prod.yml         โ† New webhook name
  .gitignore                                โ† Ignore tracking file
  docs/engineering/deployment/CICD_GUIDE.md
  docs/engineering/deployment/BRANCH_PROTECTION_SETUP.md

Created:
  docs/engineering/deployment/DISCORD_WEBHOOK_SETUP.md โ† New setup guide

See Also โ€‹

Built with VitePress