feat(ci): GitHub Release 发布后自动更新 production 分支触发生产部署 (SHA-4) - #55
Draft
WardLu wants to merge 1 commit into
Draft
Conversation
新增 release-to-production.yml:GitHub Release 发布后把 production 分支指针 快进到该 release 的 commit(strict fast-forward,绝不 force),Vercel Branch Tracking 随之触发生产构建与部署;workflow_dispatch 支持补发/重跑。回滚为 维护者手动 force-with-lease。CONTRIBUTING.md Release 闸门同步 production 分支机制与回滚命令。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 Release 发布 → 更新
production分支 → 触发 Vercel 生产部署」的发布流程(SHA-4 拆分任务 SHA-11):.github/workflows/release-to-production.yml(Deploy release to production):GitHub Release 发布(release: published)后,将production分支指针快进到该 release 的 tag commit;Vercel 的 Branch Tracking(已填production)随之触发生产构建与部署。支持workflow_dispatch手动指定 tag 补发/重跑。CONTRIBUTING.md「Release 闸门」同步production分支机制、回滚命令与保护分支取舍;发布步骤按新流程调整为线性顺序。只更新分支指针、不创建新提交、不并入
main开发内容;本 PR 不 pushproduction分支、不执行部署、不改生产数据。变更类型
方案取舍
release: published自动触发(主路径)+workflow_dispatch手动补发/重跑(兜底)。手动单独触发会增加操作摩擦且容易漏发production指针的后代,否则失败并明确报错;绝不 forceproduction永远可回滚、可追溯production当前未设保护,用GITHUB_TOKEN(contents: write)更新指针;后续启用保护时需改用细粒度 PAT/deploy key 或 environment 保护(已写入 CONTRIBUTING.md)git push --force-with-lease origin <上一个vX.Y.Z>^{commit}:production,再跑Release production verification复核release.yml负责 tag 产物验证(Release 创建前必须全绿),release-production.yml负责部署后站点验收;新增工作流只负责中间一环「更新 production 指针」,不重复验证依赖关系:创建 GitHub Release 即代表该 tag 已通过
Release verification(CONTRIBUTING.md「Release 闸门」第 2、3 条),因此本工作流不重复验证产物。检查清单
npm run check通过npm run public:check通过actionlint对本工作流及现有release.yml/release-production.yml/ci.yml均无告警.env、.vercel、secret key 或个人数据CONTRIBUTING.md;README/CHANGELOG/RELEASE_NOTES 不涉及本次内部工作流改动,无需更新npm run public:check,并复查暂存区没有内部、敏感或不必要文件验证记录
npm run check:Static checks passed.npm run public:check:Public repository check passed (0 staged paths, 178 candidate paths).actionlint 1.7.7:新增与现有工作流均无输出(无问题)production快进到目标 tag commit ✅git push --force-with-lease origin <旧tag>^{commit}:production成功,随后可再次正常快进 ✅npm run test:full等(不涉及源码/数据库/浏览器行为,按风险矩阵不适用)