Skip to content

ci: build only affected documentation and preserve historical releases - #193

Merged
xiaoxiang781216 merged 2 commits into
apache:masterfrom
Swatantra-66:ci/build-changed-docs
Oct 9, 2026
Merged

xiaoxiang781216 merged 2 commits into
apache:masterfrom
Swatantra-66:ci/build-changed-docs

Conversation

@Swatantra-66

@Swatantra-66 Swatantra-66 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #124 (and completes the final remaining sub-issue of #129).

Currently, the GitHub Actions documentation workflow (.github/workflows/main.yml) rebuilds the entire website along with all 26 historical NuttX releases (10.0.0 through 13.1.0) on every single CI run. This consumes 28 to 35 minutes of CI compute per run and repeatedly rebuilds static, immutable release tags.

This PR optimizes the CI workflow to build incrementally:

  1. Preserves Existing Historical Docs: In incremental mode, existing compiled release documentation is restored directly from the asf-site branch via git archive | tar -x in ~2 seconds without dirtying the git index.
  2. Builds Only Affected Documentation: By default (on pull_request, push, repository_dispatch, and daily cron), the workflow:
    • Automatically detects and builds any newly added release tags in NuttX that are not yet present in the documentation directory.
    • Always builds master (docs/latest) to keep online documentation in sync with NuttX core.
    • Reduces build time from ~35 minutes down to ~3 minutes (~90% compute savings).
  3. Preserves Full Rebuild Capability:
    • Added workflow_dispatch input (build_all: boolean, default false) for on-demand manual full rebuilds.
    • Added a weekly baseline full rebuild on Sunday at 00:00 UTC using deterministic github.event.schedule == '0 0 * * 0' matching (immune to runner queue delays).
  4. Hardened publish.sh:
    • Added a staged diff check before git commit to prevent workflow aborts when a run produces no publishable differences.

Impact

  • Substantially reduces Apache GitHub Actions runner minutes, aligning with ASF workflow resource policies.
  • Decreases PR review feedback loops on nuttx-website from over 30 minutes to approximately 3 minutes.
  • Ensures all historical releases remain published and accessible on nuttx.apache.org/docs/.

Testing

  • Validated git archive restoration locally against origin/asf-site: successfully extracted all 26 historical release versions in seconds with a clean git working tree.
  • Verified YAML syntax with PyYAML parser.
  • Verified zero whitespace or formatting errors via git diff --check.

Note: This PR is stacked on top of #192 (Node.js 24 actions upgrade). Once #192 is merged into master, this PR will automatically reduce to just the incremental build commit.

Resolve apache#190. GitHub Actions Node.js 20 is deprecated and will be removed
from runners. The ubuntu-latest label will also migrate to Ubuntu 26.

This upgrade bumps:
- actions/checkout from v6 to v7
- actions/setup-python from v4 to v7
- actions/upload-artifact from v5 to v7
- Python from 3.8 to 3.10

Also ensures compatibility for legacy Sphinx 4.x releases (e.g., NuttX 12.0.0)
by pinning sphinxcontrib extension versions when building older releases.

Signed-off-by: Swatantra Yadav <maverickswatantra@gmail.com>
The current documentation build process rebuilds the entire website and
all 26 historical NuttX releases (10.0.0 through 13.1.0) on every CI run,
consuming 28 to 35 minutes of CI compute and exceeding Apache Foundation
workflow resource guidelines.

Optimize the documentation workflow to build incrementally:
- In incremental mode (default on PRs, pushes, repository_dispatch, and
  daily cron), restore existing compiled release documentation directly
  from the asf-site branch via git archive in seconds.
- Automatically detect and build any newly added release tags in NuttX
  that are not yet present in the documentation directory.
- Always build master (latest docs) to keep online documentation in sync
  with the upstream repository.
- Provide a full rebuild option via workflow_dispatch (build_all: true)
  and schedule a weekly full baseline rebuild on Sundays at 00:00 UTC
  using deterministic github.event.schedule event matching.
- Guard git commit in publish.sh against clean working trees to prevent
  aborts when no changes need publishing.

Fixes apache#124

Signed-off-by: Swatantra Yadav <maverickswatantra@gmail.com>
@xiaoxiang781216 xiaoxiang781216 linked an issue Oct 9, 2026 that may be closed by this pull request
@xiaoxiang781216
xiaoxiang781216 merged commit dc1feff into apache:master Oct 9, 2026
1 check passed
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.

[WWW/DOC] NuttX RTOS Website and Documentation [WWW/DOC] CI: build only parts that changed.

2 participants