diff --git a/README.md b/README.md index 3e20620..ee9e0cb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ ## 部署到 Cloudflare 1. Fork 本项目,打开 [Workers & Pages](https://dash.cloudflare.com/?to=/:account/workers-and-pages/create),选择 **Continue with GitHub** 并导入仓库。 -2. 使用生产分支 `main`,根目录 `/`,构建命令留空,部署命令填写 `bun run deploy`。 +2. 使用生产分支 `main`,根目录 `/`,构建命令填写 `bun run build`,部署命令填写 `bun run deploy`。 3. 在创建页展开 **高级设置**,按下表添加变量。 | 变量 | 必填/可选 | 说明 | diff --git a/scripts/deploy-worker.sh b/scripts/deploy-worker.sh index ff05ef1..d8ad6c3 100644 --- a/scripts/deploy-worker.sh +++ b/scripts/deploy-worker.sh @@ -69,12 +69,7 @@ fi prepare_runtime_secrets -# Some Cloudflare deployment flows provision bindings before this script runs. -# A first deployment without that pre-provisioning needs one upload to create D1. -if ! bunx wrangler d1 info DB --json >/dev/null 2>&1; then - echo "D1 binding is not provisioned; creating it through Wrangler deploy..." - deploy_worker -fi - +# Workers Builds provisions the binding declared in wrangler.toml before running +# the deploy command, so migrations can target the binding directly. bunx wrangler d1 migrations apply DB --remote deploy_worker