Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# -in private-key.pem -out private-key-pkcs8.pem
# Then paste the full PEM (including headers) as the value, with literal \n for newlines.

# D1 database ID — find in Cloudflare dashboard under Workers & Pages > D1
CLOUDFLARE_D1_DATABASE_ID=

GITHUB_APP_ID=
GITHUB_APP_CLIENT_ID=
GITHUB_APP_PRIVATE_KEY=
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/deploy-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ jobs:
working-directory: dashboard
run: npm ci

- name: Build dashboard
working-directory: dashboard
run: npm run build

- name: Deploy Worker + assets
if: github.ref == 'refs/heads/main'
run: npx wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_D1_DATABASE_ID: ${{ secrets.CLOUDFLARE_D1_DATABASE_ID }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ node_modules/
/dist/
.*.vars
!.*.vars.example
wrangler.jsonc
!dashboard/wrangler.jsonc
*.local
*.pem
38 changes: 38 additions & 0 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "coverage-tracker",
"main": "src/index.ts",
"compatibility_date": "2026-06-25",
"compatibility_flags": ["nodejs_compat"],
"assets": {
"directory": "./dashboard/build",
"binding": "ASSETS",
"not_found_handling": "single-page-application",
"run_worker_first": ["/api/*"]
},
// Explicit build command suppresses wrangler's Hono framework auto-detection.
// Hono here is the Worker router, not a front-end framework; the SvelteKit SPA
// is built separately. Dashboard node_modules must already be installed before
// wrangler deploy runs (handled by CI's "Install dashboard dependencies" step).
"build": {
"command": "npm --prefix dashboard run build"
},
"observability": { "enabled": true },
"triggers": { "crons": ["30 6 * * *"] },
"d1_databases": [
{
"binding": "DB",
"database_name": "coverage",
"database_id": "$CLOUDFLARE_D1_DATABASE_ID",
"migrations_dir": "migrations"
}
]
// Secrets (set with `wrangler secret put <NAME>`):
// GITHUB_APP_ID
// GITHUB_APP_CLIENT_ID
// GITHUB_APP_PRIVATE_KEY — PKCS#8 PEM, see .dev.vars.example
// GITHUB_WEBHOOK_SECRET
// CF_ACCESS_AUD — Access application AUD tag
// CF_ACCESS_TEAM_DOMAIN — e.g. myteam.cloudflareaccess.com
// DEV_BYPASS_SECRET — local dev only, never set in production
}
Loading