Migrate Forest website to Workers Build

未关闭
#7,648 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions, javascript
领域
ci-cd, cloud, devops

调研方向

The issue is to migrate the forest-website deployment from Cloudflare Pages Direct Upload to Workers Build. Start by examining the linked PR (https://github.com/ChainSafe/forest-website/pull/184) to understand the current setup. The main steps involve adding a wrangler.jsonc configuration file, updating package.json to include wrangler, and configuring the Cloudflare dashboard for Workers Builds. Test locally with yarn build && npx wrangler dev and a dry-run deploy. The completion criteria is a successful migration with the custom domain attached to the new Worker.

由索引模型根据 Issue 内容生成。

描述

Type: Task

Summary

The action we were relying on is deleted, so now we have to do some manual dance because we're stuck on Direct Upload.

https://github.com/ChainSafe/forest-website/pull/184

This works, but a cleaner solution would be to migrate to something that CF really supports and doesn't put traps on.

Completion Criteria

  • Migrate Forest website to Workers Build

Additional Links & Resources

https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/
https://developers.cloudflare.com/workers/ci-cd/builds/configuration/
https://developers.cloudflare.com/workers/ci-cd/builds/git-integration/

Claude's migration steps (unverified, treat with caution)

Prerequisites (verified)

  • chainsafe.io runs on Cloudflare nameservers (gene/toby.ns.cloudflare.com). Required — Workers custom domains don't support external DNS with a CNAME, unlike Pages. This was the likeliest blocker; it's fine.
  • No functions/, no _headers, no _redirects. Nothing Pages-specific to port.
  • out/404.html exists, so 404 handling maps cleanly.

Steps

  1. Add wrangler.jsonc at repo root. Assets-only Worker, so no main and no ASSETS binding:
    {
    "name": "forest-website",
    "compatibility_date": "2026-09-22",
    "assets": {
    "directory": "./out",
    "not_found_handling": "404-page"
    }
    }

  2. Add wrangler to devDependencies. Verify locally before touching anything remote: yarn build && npx wrangler dev (port 8787, not Pages' 8788), then npx wrangler deploy --dry-run.

  3. In the Cloudflare dashboard, create the Worker and connect the GitHub repo via Workers Builds. Settings:

    • build command yarn build
    • deploy command npx wrangler deploy
    • preview deploy command npx wrangler versions upload (this is what non-production branches get)
    • enable non-production branch builds, so Dependabot branches keep getting previews
    • build variable NODE_VERSION=22 — same wrangler requirement that just failed your run
  4. Confirm it works on *.workers.dev while Pages still serves production. No user impact yet.

  5. Cut over the domain. forest.chainsafe.io can only attach to one of them, so: remove it as a custom domain from the Pages project, then add it as a Custom Domain on the Worker. This is the only step with a downtime window — keep it short and do it deliberately.

  6. Delete .github/workflows/cf-deploy.yaml. Workers Builds does check runs and PR comments natively, so the whole Record GitHub deployment step disappears with it.

  7. Clean up afterwards: delete the Pages project once you're satisfied, and drop CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID from the Actions and Dependabot secret stores if nothing else uses them.

Caveats worth knowing before you commit to this

  • The Deployments sidebar probably still won't come back. Docs promise check runs and PR comments; they don't mention GitHub Deployment environment records. Unconfirmed either way — I'd treat the sidebar as gone.
  • forest-landing.pages.dev dies. Preview URLs become version-scoped *.workers.dev URLs.
  • Pages environment variables don't carry over to Workers Builds; reconfigure them there.
  • Workers has no equivalent of Pages' branch deploy controls.
主要语言
Rust
星标
700
派生
201
平均合并
1 天 17 小时
30 天内合并 PR
65

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ChainSafe/forest 的其他 Issue

查看 ChainSafe/forest 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。