Fixes and improvements

This commit is contained in:
imengying committed 2026-08-12 08:39:58 +08:00
1 parent f7310928bf
commit 44a0ada698
2 files changed
+3 -8

No files matched your search

+1 -1
View File
@@ -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. 在创建页展开 **高级设置**,按下表添加变量。
| 变量 | 必填/可选 | 说明 |
+2 -7
View File
@@ -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