完善 CI:使用 pgvector 并部署对应提交的 Web 产物 - #2
Merged
Merged
Conversation
Merged
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.
依赖关系
这是堆叠式 PR,临时以 #1 的分支为基线,让新流水线能够同时验证管理员初始化改动。合并顺序为:先合并 #1,再把本 PR 的基线改为
main后合并。目标
修复 CI 测试数据库与迁移要求不一致的问题,并保证生产部署使用“同一次检查、同一个 commit”生成的 Nuxt 产物。Pull Request 只运行检查,绝不触发生产部署。
主要改动
mainpush 都运行 API、Admin、Web 与 AI 服务检查pgvector/pgvector:pg16,支持现有vector迁移.output、生成 SHA-256,并作为 Actions Artifact 保存 14 天main的 push 触发,并依赖所有检查成功.output,保留.output.previous,并通过 Compose--wait等待健康状态git reset --hard、固定等待和自动清理镜像已验证
API、Admin 与 Web:通过(1 分 22 秒)AI 服务:通过(50 秒)部署生产环境:在 Pull Request 中按预期跳过web-output-c3c085bba9ea49634efd37b4b89459a771273b6e已生成,下载后 SHA-256 校验通过,包含.output/server/index.mjsactionlint1.7.12:本工作流通过.output构建 Web Docker 镜像并检查镜像入口文件:通过up --wait影响与迁移
合并前需在 GitHub
productionEnvironment 配置SERVER_HOST、SERVER_USER、SSH_PRIVATE_KEY、SERVER_DEPLOY_DIR,并新增SERVER_SSH_FINGERPRINT。服务器需使用支持up --wait的 Docker Compose,部署目录中的已跟踪改动必须先处理。原来的手动
workflow_dispatch入口有意移除。服务器 Git 工作树会以 detached HEAD 方式停在实际部署 SHA,不再假定本地main就代表已部署版本。回滚
优先 revert 问题提交并推送
main,让流水线生成并部署回退提交自己的产物。服务器另保留上一份.output.previous和按 SHA 存放的传输产物,供流水线不可用时人工恢复。数据库迁移不承诺可逆,涉及数据库结构时必须配合已有备份/恢复流程。本次明确不做