diff --git a/docs/explore-stage-files.md b/docs/explore-stage-files.md index b5f4069..6ecbad4 100644 --- a/docs/explore-stage-files.md +++ b/docs/explore-stage-files.md @@ -47,3 +47,5 @@ - `apps/studio/src/pages/api/health.ts`:新增明确的健康检查接口,避免把 API 目录的 index 文件错误理解为 /api/index 路由。 - `scripts/deploy-studio.sh`:健康检查修正为 `/studio/api/health`。 - `apps/studio/src/pages/index.tsx`:AI 索引入口修正为实际 `/studio/api`。 + +- `scripts/deploy.sh`:Wiki 发布过期检查限定 Wiki 相关路径,避免 Studio 单独更新时阻止已验证的 Wiki 发布。 diff --git a/scripts/deploy.sh b/scripts/deploy.sh index e8462be..7be5b88 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -15,7 +15,12 @@ exec 9>"$APP_ROOT/.deploy.lock" flock -w 300 9 || { echo 'Another PROMPT deployment is running'; exit 1; } test "$(git -c safe.directory="$PWD" rev-parse HEAD)" = "$RELEASE_SHA" LATEST_MAIN=$(git -c safe.directory="$PWD" ls-remote origin refs/heads/main | cut -f1) -if [ "$LATEST_MAIN" != "$RELEASE_SHA" ]; then echo 'Skipping deployment: main has a newer commit'; exit 0; fi +if [ "$LATEST_MAIN" != "$RELEASE_SHA" ]; then + git -c safe.directory="$PWD" fetch origin main + if ! git -c safe.directory="$PWD" diff --quiet "$RELEASE_SHA" origin/main -- apps/wiki Dockerfile compose.yml scripts/deploy.sh scripts/infra.sh scripts/integration.sh .gitea/workflows/wiki.yml pnpm-workspace.yaml; then + echo 'Skipping deployment: Wiki has a newer commit'; exit 0 + fi +fi PREVIOUS="" if [ -L "$APP_ROOT/current" ] && [ -d "$APP_ROOT/current" ]; then PREVIOUS=$(readlink -f "$APP_ROOT/current"); fi bash scripts/infra.sh "$IMAGE"