Skip to content

Commit 2cdb3bf

Browse files
docs(readme): reflect simplified gh-pages deployment workflow
Update both English and Chinese READMEs to describe the streamlined publish path: gh-pages-only deployment with wrangler.jsonc in the payload contract, R2 handled externally, and simplified manual dispatch without publish_source modes. Co-Authored-By: Hagicode <noreply@hagicode.com> Signed-off-by: newbe36524 <newbe36524@qq.com>
1 parent 730e3ff commit 2cdb3bf

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ The local docs server runs on `http://localhost:31265` by default.
3838
## GitHub Actions
3939

4040
- `.github/workflows/docs-ci.yml` validates pushes and pull requests targeting `main`.
41-
- `.github/workflows/docs-deploy-gh-pages.yml` adds an artifact-driven dual-channel publication path for pushes to `main` and `workflow_dispatch`.
42-
- The `gh-pages` payload contract is branch-root `esa.jsonc` plus `dist/` containing the validated Astro snapshot assembled after `npm run build:ci` succeeds.
43-
- The build job stays read-only and uploads the validated payload artifact; `gh-pages` remains authoritative, only the deploy job receives `contents: write`, and the downstream `upload-r2` job reuses that same artifact instead of rebuilding.
44-
- Manual `workflow_dispatch` runs expose `publish_source` with two modes: `latest-gh-pages` replays the latest validated `gh-pages` snapshot without rebuilding, while `current-ref-build` reruns `npm run build:ci`, republishes `gh-pages`, and then uploads the same validated `dist/` payload to R2.
45-
- Configure `R2_ENDPOINT`, `R2_BUCKET`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY`, and optional `R2_PREFIX` before enabling production runs. Store them in repository secrets or the `docs-production` environment; when `R2_PREFIX` is set, use a normalized prefix root such as `docs` (no leading or trailing slash) so `.deploy/gh-pages/dist/` contents land directly at the target root without an extra `dist/` segment.
41+
- `.github/workflows/docs-deploy-gh-pages.yml` publishes a validated `gh-pages` payload for pushes to `main` and `workflow_dispatch`.
42+
- The `gh-pages` payload contract is branch-root `esa.jsonc`, `wrangler.jsonc`, and `dist/` containing the validated Astro snapshot assembled after `npm run build:ci` succeeds.
43+
- The build job stays read-only and uploads the validated payload artifact; `gh-pages` remains authoritative and only the deploy job receives `contents: write`.
44+
- Manual `workflow_dispatch` runs rebuild from the selected ref, validate with `npm run build:ci`, and republish the resulting payload to `gh-pages`.
45+
- Direct Cloudflare publication is handled outside this workflow; keep `gh-pages/wrangler.jsonc` as the versioned deployment contract used by direct publish operations.
4646
- Existing workflows remain in place: `.github/workflows/docs-ci.yml`, `.github/workflows/azure-static-web-apps-agreeable-stone-04924c800.yml`, `.github/workflows/compress-images.yml`, and `.github/workflows/indexnow.yml` are additive peers, not replaced by the new workflow.
47-
- Treat host cutover as a separate operational step: adding the workflow does not prove `docs.hagicode.com` already reads `gh-pages/esa.jsonc` and `gh-pages/dist/`.
48-
- Follow-up checks before treating `docs.hagicode.com` as a `gh-pages` consumer: confirm the workflow published `esa.jsonc` and `dist/`, verify the hosting target still points at `gh-pages`, and then load `https://docs.hagicode.com` from the deployed branch snapshot.
47+
- Treat host cutover as a separate operational step: adding the workflow does not prove `docs.hagicode.com` already reads `gh-pages/esa.jsonc`, `gh-pages/wrangler.jsonc`, and `gh-pages/dist/`.
48+
- Follow-up checks before treating `docs.hagicode.com` as a `gh-pages` consumer: confirm the workflow published `esa.jsonc`, `wrangler.jsonc`, and `dist/`, verify the hosting target still points at `gh-pages`, and then load `https://docs.hagicode.com` from the deployed branch snapshot.
4949
- This change migrates only `repos/docs`; `repos/awesome-design-md-site`, `repos/cost`, `repos/index`, `repos/soul`, `repos/trait`, and `repos/docker-compose-builder-web` remain unchanged follow-up migration candidates.
5050
- `.github/workflows/compress-images.yml` and `.github/workflows/indexnow.yml` handle repository maintenance automation.
5151

README_cn.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ npm run preview
3838
## GitHub Actions
3939

4040
- `.github/workflows/docs-ci.yml` 负责对 `main` 的 push 与 pull request 做校验。
41-
- `.github/workflows/docs-deploy-gh-pages.yml` `main` push 与 `workflow_dispatch` 新增了一个基于 artifact handoff 的双通道发布路径
42-
- `gh-pages` 的 payload 契约是:分支根目录保留 `esa.jsonc`,并在 `npm run build:ci` 校验通过后把可发布的 Astro 产物组装到 `dist/`
43-
- build job 保持只读并上传校验后的 payload artifact;`gh-pages` 仍然是权威发布面,只有 deploy job 获得 `contents: write`,下游 `upload-r2` job 也只会复用同一个 artifact,而不会再次构建
44-
- 手动 `workflow_dispatch` 现在提供 `publish_source` 两种模式:`latest-gh-pages` 直接复用最近一次 `gh-pages` 快照而不重建;`current-ref-build` 则重新执行 `npm run build:ci`、重发 `gh-pages`,再把同一个校验过的 `dist/` payload 上传到 R2
45-
- 在启用生产运行前,先配置 `R2_ENDPOINT``R2_BUCKET``R2_ACCESS_KEY_ID``R2_SECRET_ACCESS_KEY`,以及可选的 `R2_PREFIX`。这些值可以放在仓库 secrets 或 `docs-production` environment 中;如果设置 `R2_PREFIX`,请使用类似 `docs` 这种去掉首尾 `/` 的前缀,让 `.deploy/gh-pages/dist/` 的内容直接落在目标根路径下,而不是额外生成一层 `dist/`
41+
- `.github/workflows/docs-deploy-gh-pages.yml` 会在 `main` push 与 `workflow_dispatch` 时发布一份经过校验的 `gh-pages` payload
42+
- `gh-pages` 的 payload 契约是:分支根目录保留 `esa.jsonc``wrangler.jsonc`,并在 `npm run build:ci` 校验通过后把可发布的 Astro 产物组装到 `dist/`
43+
- build job 保持只读并上传校验后的 payload artifact;`gh-pages` 仍然是权威发布面,只有 deploy job 获得 `contents: write`
44+
- 手动 `workflow_dispatch` 会基于所选 ref 重新执行 `npm run build:ci`,并把生成的 payload 重新发布到 `gh-pages`
45+
- Cloudflare 直接发布现在在这个 workflow 之外处理;请把 `gh-pages/wrangler.jsonc` 视为直接发布操作使用的受版本控制契约
4646
- 现有工作流保持不变:`.github/workflows/docs-ci.yml``.github/workflows/azure-static-web-apps-agreeable-stone-04924c800.yml``.github/workflows/compress-images.yml``.github/workflows/indexnow.yml` 都继续保留,新工作流只是附加能力。
47-
- 不要把新增工作流等同于生产切换:仅添加工作流,并不能证明 `docs.hagicode.com` 已经开始读取 `gh-pages/esa.jsonc``gh-pages/dist/`
48-
- 在把 `docs.hagicode.com` 视为 `gh-pages` 消费方之前,先完成后续检查:确认工作流实际发布了 `esa.jsonc``dist/`,确认托管目标仍然指向 `gh-pages`,然后再访问 `https://docs.hagicode.com` 验证部署结果。
47+
- 不要把新增工作流等同于生产切换:仅添加工作流,并不能证明 `docs.hagicode.com` 已经开始读取 `gh-pages/esa.jsonc``gh-pages/wrangler.jsonc``gh-pages/dist/`
48+
- 在把 `docs.hagicode.com` 视为 `gh-pages` 消费方之前,先完成后续检查:确认工作流实际发布了 `esa.jsonc``wrangler.jsonc``dist/`,确认托管目标仍然指向 `gh-pages`,然后再访问 `https://docs.hagicode.com` 验证部署结果。
4949
- 这次变更只迁移 `repos/docs``repos/awesome-design-md-site``repos/cost``repos/index``repos/soul``repos/trait``repos/docker-compose-builder-web` 继续保持不变,作为后续迁移候选项。
5050
- `.github/workflows/compress-images.yml``.github/workflows/indexnow.yml` 负责仓库维护类自动化。
5151

0 commit comments

Comments
 (0)