Skip to content

ci: 添加官网 GitHub Actions 生产部署(Environment production) - #94

Merged
zh30 merged 1 commit into
mainfrom
cursor/deploy-website-workflow-2110
Sep 19, 2026
Merged

zh30 merged 1 commit into
mainfrom
cursor/deploy-website-workflow-2110

Conversation

@zh30

@zh30 zh30 commented Sep 18, 2026

Copy link
Copy Markdown
Owner

变更范围

  • 新增 .github/workflows/deploy-website.yml:在 main 上当 apps/website/**install.shinstall.ps1 或该 workflow 变更时部署;同时支持 workflow_dispatch
  • Job deploy 绑定 GitHub Environment production,只读 contents,用 Environment 的 secrets.CLOUDFLARE_API_TOKENvars.CLOUDFLARE_ACCOUNT_ID(不把 token 写进 YAML)。
  • pnpm run deploy 发布 Cloudflare Worker + 静态资源;随后把仓库根目录的 install.sh / install.ps1 上传到 R2 amber-dist,避免 R2 旧对象遮住 Worker assets。
  • 更新 apps/website/README.md 的 Cloudflare Deploy 说明:生产走 Actions,本地仍可用 pnpm run deploy / deploy:dry-run

影响模块

  • CI / 官网发布(apps/websiteget.amberjs.com 安装脚本)
  • 未改 install.sh / install.ps1 逻辑,也未改 worker.ts 或其他 workflow

如何验证

  1. 合并后到 Actions → Deploy website → Run workflow 手动跑一次(Environment production 需已配置 token / account id)。
  2. 确认 https://amberjs.com 仍可打开。
  3. 确认 https://get.amberjs.com/install.sh 为最新脚本,内容包含 bee- 回退(legacy bee-<tag>-<target>.tar.gz / bee-${version_tag})。当前线上脚本约 4158 字节、content-type: application/x-sh不含 bee-;仓库里的 install.sh 已有回退(5714 字节)。合并并部署后应能看到 bee-
  4. 本地仍可:cd apps/website && pnpm run deploy:dry-run

已运行检查

  • YAML 结构校验:environment: production、path filter、workflow_dispatchcheckout@v4、pnpm 11.21.0、Node 22。
  • actionlint v1.7.7 通过。
  • 对照 wrangler 4.x:r2 object put 使用 {bucket}/{key}--content-type 需加引号;--bucket 不是该子命令的合法 flag。
  • 未在本分支实际调用 Cloudflare(无权限、也不应把 token 写进 CI)。

未验证项

  • 合并后的真实 wrangler deploy 与 R2 object put(依赖 Henry 已配置的 production Environment)。
  • 线上 get.amberjs.com 在本次 PR 合并前不会变化。

相关文档

  • apps/website/README.md
  • apps/website/wrangler.tomlamberjs-website,域名 amberjs.com / www.amberjs.com / get.amberjs.com,R2 amber-dist
  • docs/skills/deploy-cloudflare-website/SKILL.md
Open in Web Open in Cursor 

通过 GitHub Environment production 的 secrets/vars 部署 Worker 与安装脚本,避免把 token 写进仓库。

Co-authored-by: Henry Zhang <hello@zhanghe.dev>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a4690b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@zh30
zh30 marked this pull request as ready for review September 19, 2026 01:21
@zh30
zh30 merged commit c8d0f78 into main Sep 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants