Deployment
Cloudflare Setup
1. Create KV Namespace
bash
npx wrangler kv namespace create KVThis outputs a namespace ID. Update wrangler.jsonc with the ID:
jsonc
{
"kv_namespaces": [
{
"binding": "KV",
"id": "your-namespace-id",
},
],
}2. Set Secrets
bash
npx wrangler secret put GITHUB_WEBHOOK_SECRET
npx wrangler secret put GITHUB_APP_ID
npx wrangler secret put GITHUB_PRIVATE_KEY
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET
npx wrangler secret put DISCORD_TOKEN
npx wrangler secret put DISCORD_CHANNEL_ID3. Deploy
bash
npx wrangler deployYour worker is now live at https://webhooker.<your-subdomain>.workers.dev.
4. Configure GitHub Webhook
- Go to your GitHub App settings
- Set Webhook URL to
https://webhooker.<your-subdomain>.workers.dev/webhook - Set Webhook secret to match
GITHUB_WEBHOOK_SECRET
GitHub App Setup
1. Create App
- Go to https://github.com/settings/apps/new
- Fill in:
- GitHub App name:
WebHooker(or your choice) - Homepage URL: your domain
- Webhook URL:
https://your-domain/webhook - Webhook secret: generate and copy to
GITHUB_WEBHOOK_SECRET
- GitHub App name:
- Set permissions:
- Repository permissions: Contents (read), Issues (write), Pull requests (write), Metadata (read)
- Organization permissions: Members (read) — if needed
- Subscribe to events (all 23 supported):
- Push, Pull request, Issues, Issue comment, Workflow run, Release, Create, Delete, Star, Fork, Check run, Pull request review, Pull request review comment, Commit comment, Deployment status, Member, Label, Milestone, Discussion, Discussion comment, Repository, Code scanning alert, Dependabot alert
- Generate private key → save contents to
GITHUB_PRIVATE_KEYenv var
2. Install App
- After creation, go to the App settings page
- Click "Install App" → select org/user
- Choose repositories to monitor
3. Configure OAuth
- Go to App → OAuth settings
- Set Callback URL:
https://your-domain/auth/github/callback - Copy Client ID and Client Secret to env
Discord Bot Setup
- Go to https://discord.com/developers/applications
- Create a new application → go to Bot section
- Copy the bot token to
DISCORD_TOKEN - Invite the bot to your server with
botscope andSend Messagespermission - Copy the target channel ID to
DISCORD_CHANNEL_ID
Custom Domain (Optional)
To use a custom domain instead of *.workers.dev:
- Go to your Cloudflare Worker settings
- Add a custom domain or route
- Update
BASE_URLto match
Docker
A Dockerfile is provided for containerized deployments (e.g., behind a reverse proxy):
bash
docker build -t webhooker .
docker run -p 8787:8787 --env-file .env webhookerNote: Docker mode runs without Durable Objects and KV. Use Cloudflare deployment for full functionality.