瀏覽代碼

【新增,CI】发布前增加冒烟验证

手动 push master 此前直接构建推送 GHCR 镜像,未经任何测试。新增 verify job:提取 DSH_VERSION 后运行 scripts/smoke-test.sh(basic auth、特权 API fence、双进程、trustedHosts 注入),失败则 build job 不执行。
PJ568 3 月之前
父節點
當前提交
44e58384a0
共有 1 個文件被更改,包括 23 次插入 和 0 次删除
  1. 23 0
      .github/workflows/docker-build.yml

+ 23 - 0
.github/workflows/docker-build.yml

@@ -13,7 +13,30 @@ env:
   IMAGE: ghcr.io/xidong-ai/deepseek-harness-web-docker
 
 jobs:
+  # 推送前冒烟:构建镜像并跑端到端检查(basic auth / 特权 API fence / 双进程 / trustedHosts 注入),失败则不推送
+  # 手动 push 的代码不再未经验证直接发布
+  #
+  # Pre-push smoke test: build the image and run end-to-end checks (basic auth / privileged-API fence /
+  # both processes / trustedHosts injection); a failure blocks the push, so manually pushed code
+  # is no longer published unverified
+  verify:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: 提取 DSH_VERSION
+        id: version
+        run: |
+          echo "version=$(grep -E '^ARG DSH_VERSION=' Dockerfile | head -n1 | cut -d= -f2)" >> "$GITHUB_OUTPUT"
+
+      - name: 构建并冒烟测试
+        run: |
+          scripts/smoke-test.sh "${{ steps.version.outputs.version }}"
+
   build:
+    needs: verify
     runs-on: ubuntu-latest
     permissions:
       contents: read