Skip to content

ci: squash gh-pages history on every release - #15743

Merged
susnux merged 1 commit into
masterfrom
feature/squash-gh-pages-history
Oct 8, 2026
Merged

susnux merged 1 commit into
masterfrom
feature/squash-gh-pages-history

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Oct 8, 2026

Copy link
Copy Markdown
Member

gh-pages is 3.54 GiB of the repository's 3.7 GB and grows by about 18 MiB a day, because every deploy commits a full set of rebuilt PDF and ePub files. Switching to the daily deploy in May lowered the number of commits, but not the growth (17.8 MiB/day per push, 16.2 daily per version, 18.0 daily single PR).

This adds a workflow that runs on each final release tag and rewrites gh-pages as:

  • one snapshot commit per release day, holding the last deploy of that day,
  • the deploys made since the last release, unchanged,
  • version folders below the lowest supported version (from build/detect-versions.php, so 12 to 32 today) stored once, with their current content.

The published tree is unchanged, and the script checks that before pushing. Running it again on its own output changes nothing, so several tags pushed on the same day are fine.

Measured on a full clone of the current gh-pages: 347 commits down to 20, 3621 MiB down to 852 MiB packed. After that, growth should be roughly 25 to 30 MiB per release, plus the unreleased deploys until the next release squashes them.

Important

The "Pages" ruleset blocks force pushes to gh-pages and only lets org admins bypass it. Before this can run, an admin has to create a deploy key with write access, add it as a bypass actor on that ruleset, and store its private key as the GH_PAGES_DEPLOY_KEY secret.

☑️ Resolves

  • No issue, discussed internally

🖼️ Screenshots

No visual change, CI only.

✅ Checklist

  • I have built the documentation locally and reviewed the output (not applicable, no docs change)
  • Screenshots are included for visual changes (none)
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

Tested with the 9 unit tests in build/tests and by running the script on a full local clone of gh-pages. I have not run the workflow on GitHub, the force push and the PR closing step are untested.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Oct 8, 2026
Each deploy commits a full set of rebuilt PDF and ePub files, so gh-pages
grows by ~18 MiB a day and is now 3.5 GiB of the repository's 3.7 GB.

On each final release tag, rebuild gh-pages as one snapshot commit per
release day, keep the deploys made since the last release, and store
out-of-support version folders only once. The tip tree is unchanged and the
rewrite is deterministic, so re-running it is a no-op.

Assisted-by: ClaudeCode
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv
skjnldsv force-pushed the feature/squash-gh-pages-history branch from 298c2eb to 706ca9e Compare October 8, 2026 13:13
@skjnldsv
skjnldsv requested a review from SystemKeeper October 8, 2026 13:40
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

No RST documentation pages changed in this PR.

Last updated: Thu, 08 Oct 2026 13:46:10 GMT

@susnux
susnux merged commit cd13187 into master Oct 8, 2026
27 checks passed
@susnux
susnux deleted the feature/squash-gh-pages-history branch October 8, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants