From af856b6c4acf0de7ce90385f7d99a2c5cb9d4eee Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Wed, 1 Apr 2026 14:36:54 -0400 Subject: [PATCH] docs: update README to clarify deployment steps for Cloudflare Workers Builds and D1 database configuration Signed-off-by: Okiki Ojo --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f832487..e81c242 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,8 @@ D1_DATABASE_ID= pnpm deploy If your remote database is not named `cloudflare-ddns-db`, also set `D1_DATABASE_NAME`. The `predeploy` script writes those values into `wrangler.jsonc` in the deploy workspace before validation and migrations run. +If you use Cloudflare Workers Builds with Git integration, set the project Deploy command to `pnpm deploy` instead of `npx wrangler deploy`. Workers Builds defaults to calling Wrangler directly, which skips the package-script lifecycle and therefore skips this repository's `predeploy` step. + ### 3. Set secrets ```sh @@ -154,6 +156,8 @@ This runs D1 migrations automatically before deploying. For automated deploys, export `D1_DATABASE_ID` in the job environment before running `pnpm deploy`. You only need `D1_DATABASE_NAME` if the bound database name differs from the default. +For Workers Builds specifically, add `D1_DATABASE_ID` under Cloudflare dashboard Settings > Build > Build variables and secrets. Runtime Worker secrets from Settings > Variables & Secrets are not exposed to the build/deploy process. + ## Environment variables These non-secret variables live in `wrangler.jsonc` and can be overridden per-environment: -- 2.51.2