Skip to content

ci(release): deploy published releases to production - #953

Open
huyanxius wants to merge 3 commits into
1024XEngineer:mainfrom
huyanxius:ci/release-auto-deploy
Open

huyanxius wants to merge 3 commits into
1024XEngineer:mainfrom
huyanxius:ci/release-auto-deploy

Conversation

@huyanxius

Copy link
Copy Markdown
Collaborator

正式 Release 创建后自动部署到 windup.xin,固定使用该版本的 tag/SHA。普通 main 更新不会部署,本 PR 不提升 VERSION 或发布新版本。

Why

现有 Version 工作流已负责 CI 闸口、Tag 和 Release,上线仍靠人工操作。把部署直接接在同一工作流后,也避免 GITHUB_TOKEN 创建 Release 不触发另一个工作流的问题。

Changes

  • 增加 needs: release 的 Production 部署,沿用服务器现有 Compose,配置串行执行和 SSH 主机校验。
  • 拒绝覆盖已跟踪的服务器修改,保留 .env 和 override;核对 tag/SHA 与 main 祖先关系后部署确切提交。
  • 前端编译成功后才复制静态产物,后端启动后探测健康并记录版本;已完成版本可幂等重试,旧版本不能自动覆盖新版。
  • 更新贡献指南和部署操作说明。Production 的四项环境 Secrets 已配置,值未进入仓库。

Verification

  • uv run --no-project --with pytest==8.3.4 python -m pytest -q tests/test_version_gate.py tests/test_release_deploy.py:39 passed,包含真实 Git 仓库中 main 前进后仍部署 tag、保留本地配置的验证。
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -shellcheck= .github/workflows/version.yml:通过工作流语法与表达式检查;未运行 ShellCheck。
  • git diff --check:通过。
  • 首次真实 Release 自动部署:未执行,本 PR 尚未合并,不将未合并代码部署到生产。

Scope

仅补 Release 后的前后端与 worker 自动部署;不改应用功能、VERSION、路由、数据卷或服务器登录配置。不增加部署人工审批,保留现有 PR Review 与 CI。不是零停机或原子发布;启动/健康失败可能产生部分更新,不会自动回退数据库。恢复方式见部署说明。

Related Issues

Closes #952
Refs #653

Published releases currently require a manual server update.

Chain a pinned Compose deployment after release creation with serialized execution and health checks.

Ordinary main updates stay undeployed and failed releases can be retried.
Release deployment must not select later commits or conceal build failures.

Exercise release selection, failure handling and a real Git checkout with preserved server configuration.

Regressions are checked without connecting to production services.
The contribution guide still describes manual deployment after a release.

Document production secrets, pinned releases, verification and failure retries.

Maintainers can operate the automated path without changing the release policy.
@vercel

vercel Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
windup Ignored Ignored Preview Sep 20, 2026 6:58am UTC

@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #953   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files         193      193           
  Lines       13204    13204           
=======================================
  Hits        12052    12052           
  Misses       1152     1152           
Flag Coverage Δ
backend 91.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查了 Release 选择、远程部署脚本、Compose 更新顺序以及失败/重试边界。发现一个会阻止每次全新生产部署完成的健康检查路径错误;其余新增回归测试通过。

验证:python3 -m unittest discover -s tests -p test_release_deploy.py -v 通过(15 tests);git diff --check 通过。环境未安装 pytest,因此未运行 pytest 命令。

Comment thread scripts/release_deploy.py
execute(
"curl", "--fail", "--silent", "--show-error", "--retry", "12",
"--retry-all-errors", "--retry-delay", "5", "--max-time", "10",
"http://127.0.0.1:8000/api/health",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Probe the backend's actual local health route

deploy() runs this curl directly against 127.0.0.1:8000, which bypasses nginx, but the backend registers its health endpoint as /health (see backend/packages/app/src/windup_app/bootstrap/app.py:151). /api/health is the browser/nginx-facing prefix and is not served by the backend on port 8000, so every fresh release deployment will start the services and then fail here; the deployment markers are never written and the Actions job reports failure. Use the local /health route (and add an assertion for the URL to the new tests).

This branch has not been deployed

No deployments
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.

[Feature]: Release 发布后自动部署生产环境

1 participant