ci: 添加官网 GitHub Actions 生产部署(Environment production) - #94
Merged
Merged
Conversation
通过 GitHub Environment production 的 secrets/vars 部署 Worker 与安装脚本,避免把 token 写进仓库。 Co-authored-by: Henry Zhang <hello@zhanghe.dev>
|
zh30
marked this pull request as ready for review
September 19, 2026 01:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更范围
.github/workflows/deploy-website.yml:在main上当apps/website/**、install.sh、install.ps1或该 workflow 变更时部署;同时支持workflow_dispatch。deploy绑定 GitHub Environmentproduction,只读contents,用 Environment 的secrets.CLOUDFLARE_API_TOKEN与vars.CLOUDFLARE_ACCOUNT_ID(不把 token 写进 YAML)。pnpm run deploy发布 Cloudflare Worker + 静态资源;随后把仓库根目录的install.sh/install.ps1上传到 R2amber-dist,避免 R2 旧对象遮住 Worker assets。apps/website/README.md的 Cloudflare Deploy 说明:生产走 Actions,本地仍可用pnpm run deploy/deploy:dry-run。影响模块
apps/website、get.amberjs.com安装脚本)install.sh/install.ps1逻辑,也未改worker.ts或其他 workflow如何验证
production需已配置 token / account id)。https://amberjs.com仍可打开。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-。cd apps/website && pnpm run deploy:dry-run。已运行检查
environment: production、path filter、workflow_dispatch、checkout@v4、pnpm 11.21.0、Node 22。actionlintv1.7.7 通过。r2 object put使用{bucket}/{key},--content-type需加引号;--bucket不是该子命令的合法 flag。未验证项
wrangler deploy与 R2object put(依赖 Henry 已配置的productionEnvironment)。get.amberjs.com在本次 PR 合并前不会变化。相关文档
apps/website/README.mdapps/website/wrangler.toml(amberjs-website,域名amberjs.com/www.amberjs.com/get.amberjs.com,R2amber-dist)docs/skills/deploy-cloudflare-website/SKILL.md