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
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ jobs:
working-directory: dashboard
run: npm ci

- name: Inject Database ID into wrangler.jsonc
- name: Inject Database ID into wrangler.json
env:
DB_ID: ${{ secrets.CLOUDFLARE_D1_DATABASE_ID }}
run: |
# Use jq to update the database_id inside the d1_databases array
npx strip-json-comments-cli wrangler.jsonc | jq '.d1_databases[0].database_id = env.DB_ID' > wrangler.json.tmp
jq '.env.prod.d1_databases[0].database_id = env.DB_ID' > wrangler.json.tmp

# Replace the old file with the newly updated one
mv wrangler.json.tmp wrangler.jsonc
mv wrangler.json.tmp wrangler.json

- name: Deploy Worker + assets
if: github.ref == 'refs/heads/main'
run: npx wrangler deploy
run: npx wrangler deploy --env prod
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
15 changes: 13 additions & 2 deletions worker-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 5528744f105d1f1ed430514a0d4c2f38)
// Generated by Wrangler by running `wrangler types` (hash: 4da199130f00b626578a818ba765ff7b)
// Runtime types generated with workerd@1.20260625.1 2026-06-25 nodejs_compat
interface __BaseEnv_Env {
DB?: D1Database;
ASSETS: Fetcher;
DEV_BYPASS_SECRET?: string;
DB?: D1Database;
GITHUB_APP_ID?: string;
GITHUB_APP_CLIENT_ID?: string;
GITHUB_APP_PRIVATE_KEY?: string;
Expand All @@ -17,9 +17,20 @@ declare namespace Cloudflare {
mainModule: typeof import("./src/index");
}
interface DevEnv {
DB: D1Database;
ASSETS: Fetcher;
DEV_BYPASS_SECRET: string;
}
interface ProdEnv {
DB: D1Database;
ASSETS: Fetcher;
GITHUB_APP_ID: string;
GITHUB_APP_CLIENT_ID: string;
GITHUB_APP_PRIVATE_KEY: string;
GITHUB_WEBHOOK_SECRET: string;
CF_ACCESS_AUD: string;
CF_ACCESS_TEAM_DOMAIN: string;
}
interface Env extends __BaseEnv_Env {}
}
interface Env extends __BaseEnv_Env {}
Expand Down
40 changes: 21 additions & 19 deletions wrangler.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@
"build": {
"command": "npm --prefix dashboard run build"
},
"observability": { "enabled": true },
"triggers": { "crons": ["30 6 * * *"] },
"d1_databases": [
{
"binding": "DB",
"database_name": "coverage",
"migrations_dir": "migrations"
}
],
"secrets": {
"required": [
"GITHUB_APP_ID",
"GITHUB_APP_CLIENT_ID",
"GITHUB_APP_PRIVATE_KEY",
"GITHUB_WEBHOOK_SECRET",
"CF_ACCESS_AUD",
"CF_ACCESS_TEAM_DOMAIN"
]
},
"env": {
"dev": {
"d1_databases": [
Expand All @@ -47,6 +28,27 @@
"DEV_BYPASS_SECRET"
],
}
},
"prod": {
"observability": { "enabled": true },
"triggers": { "crons": ["30 6 * * *"] },
"d1_databases": [
{
"binding": "DB",
"database_name": "coverage",
"migrations_dir": "migrations"
}
],
"secrets": {
"required": [
"GITHUB_APP_ID",
"GITHUB_APP_CLIENT_ID",
"GITHUB_APP_PRIVATE_KEY",
"GITHUB_WEBHOOK_SECRET",
"CF_ACCESS_AUD",
"CF_ACCESS_TEAM_DOMAIN"
],
}
}
}
}
Loading