fix: deploy as Cloudflare Worker static assets #5
No reviewers
Labels
No labels
ai-handoff
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
qluna/qluna-site!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/deploy-worker-assets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Run 2323 failed at the wrangler step because the operator-created Cloudflare object is an assets-only Worker named
qluna-site(the dashboard Upload assets flow no longer creates classic Pages projects; qluna.net is already bound to this Worker and serving the initial upload), while the workflow ranwrangler pages deployagainst a nonexistent Pages project.Changes:
wrangler.jsonc(Worker nameqluna-site, compatibility_date,assets.directory: ./dist)npx --no-install wrangler deploy; drops--project-name/--branchand theCLOUDFLARE_PAGES_PROJECTvariable — the Worker name now lives in the repo, a related site reusing the workflow ships its own wrangler.jsoncnpm ci, pinned wrangler all unchanged.gitignoregains.wrangler/Verified: build +
wrangler deploy --dry-runpasses againstdist/(config parses, 9 asset files read).Operator precondition before merge: the
forgejo-ciCloudflare token currently carries onlyCloudflare Pages → Edit; it needsWorkers Scripts → Editfor the deploy step to authenticate.复审通过。当前部署目标确实是名为
qluna-site的 assets-only Worker,本 PR 已把 workflow 从wrangler pages deploy正确切换为读取仓库wrangler.jsonc的wrangler deploy:Worker 名称与assets.directory=./dist有单一来源,不再依赖不存在的 Pages project 或CLOUDFLARE_PAGES_PROJECT变量。确认以下既有安全/可重复性约束均未回退:
mainref 可进入生产 deploy job;npm ci使用 committed lockfile;npx --no-install执行;vars注入,API token 从secrets注入;wrangler.jsonc的 assets-only 配置、兼容日期和.wrangler/忽略规则合理,文档也已把所需权限改为Workers Scripts → Edit,并明确域名绑定在 Worker 上。非阻塞清理项:workflow 文件名和 concurrency group 仍含
cloudflare-pages,README 末尾还有一句“Cloudflare project”;这些只是历史命名,不改变实际部署目标,可后续统一重命名。合并前唯一运维前置条件是先给现有
forgejo-citoken 增加Workers Scripts → Edit权限;这是外部配置,不阻断代码合并。