Skip to content

[INFRA] Reuse docs Docker image and composite action in pages.yml#56204

Draft
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:infra-merge-page-doc
Draft

[INFRA] Reuse docs Docker image and composite action in pages.yml#56204
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:infra-merge-page-doc

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

@zhengruifeng zhengruifeng commented May 29, 2026

What changes were proposed in this pull request?

This PR does two things:

  1. Adds a reusable workflow at .github/workflows/build-docs.yml that encapsulates the full docs job logic: branch-specific setup, Bundler/gem installation, optional version-string patching, the SKIP_API pre-build, dev/is-changed.py change detection, and the final bundle exec jekyll build. It also accepts a commit_sha input used as a suffix in the fork-preview tar filename. When upload_site: true it uploads docs/_site as artifact `docs-site` for Pages deployment.

  2. Updates pages.yml to call the reusable workflow (using the same pre-built Docker image cache that `build_and_test.yml` already uses), then deploy the uploaded artifact in a separate `deploy` job. This eliminates the ~100 lines of duplicated setup that previously re-installed Java, Python 3.11, Ruby, Pandoc, and pip packages from scratch on every master push.

`build_and_test.yml`'s `docs` job is replaced by a one-liner `uses:` call to the reusable workflow, removing ~120 lines of inline steps.

Why are the changes needed?

`pages.yml` was installing all documentation tooling from scratch on a bare runner, duplicating the setup that `build_and_test.yml` does via a pre-built Docker image. This caused version skew (Python 3.11 vs 3.12, different pip pins) and wasted CI time on every master push.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Workflow-only change; no unit tests. The reusable workflow logic is identical to the inline steps it replaces, verified by inspection.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (https://claude.ai/code)

@zhengruifeng zhengruifeng force-pushed the infra-merge-page-doc branch 4 times, most recently from 0df5c04 to 967f6e3 Compare May 29, 2026 15:00
…s.yml

In build_and_test.yml:
- For master (inputs.branch == ''), always build the full documentation site
  without SKIP_PYTHONDOC / SKIP_RDOC change detection, so the deployed site
  is always complete.
- Upload docs/_site as artifact docs-site-<branch>-<sha> (retention: 1 day).

In pages.yml:
- Replace the self-contained build with a workflow_run trigger that fires
  after the "Build" workflow completes on master.
- The deploy job prints the triggering commit title, downloads the artifact
  produced by CI, and publishes it to GitHub Pages — no build tooling needed.

Generated-by: Claude Code (https://claude.ai/code)
@zhengruifeng zhengruifeng force-pushed the infra-merge-page-doc branch from 967f6e3 to b07028c Compare May 29, 2026 15:09
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.

1 participant