Speed up staging with one targeted partial checkout
Description
Staging currently downloads the full history of every branch and tag twice. In run 35240766210, those checkouts took 3m 51s of a 6m workflow; Hugo took 43s.
Aggregate PRs and build Hugo in one checkout. Fetch only the full ancestry of main and selected PR refs, using a blobless partial clone so historical file contents are downloaded on demand. PR refs support both same-repository and fork previews. Preserve Git-derived page dates, conflict skipping, manual single-PR previews, force deployment, and scheduled reporting. Deployment requires a successfully uploaded site artifact. Keep the staging write token scoped to the aggregation step's Git pushes rather than persisting it into the build.
Type of Change
- Content/documentation update
- New feature
- Bug fix
- Breaking change
Testing
- Tested locally
- Previewed on staging.forrt.org
- Not tested yet
Validation completed:
- Actionlint passes with existing ShellCheck SC2129 style suggestions excluded;
git diff --checkpasses. - Executed the workflow's fetch and aggregation commands against temporary Git repositories: successful merges, conflict recovery, fork PR refs, manual single-PR mode, no open PRs, and rejection of an invalid/closed PR.
- Hugo page dates from the partial clone match a full clone, including an older page with an accented filename.
- All 12 existing data-artifact tests pass.
- A complete build of the real site from a fresh partial clone passes with the workflow's pinned Hugo 0.158.0 extended version: 3,545 pages and 180 processed images.
Checklist
- Self-reviewed my changes
- Verified links and formatting are correct
- No new warnings or errors
Notes
A local cold checkout plus full main history took 55.4 seconds, with the history restoration taking under a second. These local timings are not directly comparable with GitHub-hosted runners; the PR's staging run will provide the hosted measurement. The existing queueing policy remains in place.
@richarddushime could you review the workflow changes, particularly the combined job, partial fetching, and deployment conditions?