fix(ci): prevent gh-pages branch bloat#6340
Merged
blackgirlbytes merged 3 commits intomainfrom Jan 5, 2026
Merged
Conversation
The gh-pages branch grew to 9.6GB due to `keep_files: true` which preserved all old assets across deployments. Docusaurus hashes asset filenames, so renamed/updated images created new files while old ones remained forever. Changes: - Set `keep_files: false` to do clean deployments - Set `force_orphan: true` to prevent git history bloat - Add step to preserve pr-preview/ directory before deploying (so active PR previews aren't deleted) This ensures each deployment is a clean slate with only: 1. The current documentation build 2. Active PR preview directories
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes GitHub Pages deployment failures caused by the gh-pages branch growing to 9.6 GB. The solution changes from incremental deployments to clean deployments while preserving active PR previews.
Key changes:
- Switches from
keep_files: truetokeep_files: falseto prevent accumulation of orphaned hashed assets - Adds
force_orphan: trueto prevent git history bloat - Manually preserves the
pr-preview/directory by copying it from the current gh-pages branch before deployment
Both workflows now use 'concurrency: pr-preview' to serialize operations on the gh-pages branch, preventing a race condition where a PR preview created between checkout and deploy would be lost.
Handles edge case where gh-pages branch doesn't exist (first deploy or forks).
dianed-square
approved these changes
Jan 5, 2026
jamadeo
approved these changes
Jan 5, 2026
Collaborator
jamadeo
left a comment
There was a problem hiding this comment.
Nice! Looks like a clean solution to reducing the bloat of old pr preview deployments.
alexhancock
approved these changes
Jan 5, 2026
zanesq
added a commit
that referenced
this pull request
Jan 6, 2026
* 'main' of github.com:block/goose: refactor: when changing provider/model,load existing provider/model (#6334) chore: refactor configure_extensions_dialog to reduce line count (#6277) chore: refactor handle_configure to reduce line count (#6276) chore: refactor interactive session to reduce line count (#6274) chore: refactor docx_tool to reduce function size (#6273) chore: refactor cli() function to reduce line count (#6272) make sure the models are using streaming properly (#6331) feat: add a max tokens env var (#6264) docs: slash commands topic (#6333) fix(ci): prevent gh-pages branch bloat (#6340) chore(deps): bump qs and body-parser in /documentation (#6338) Skip the smoke tests for dependabot PRs (#6337)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
gh-pagesbranch grew to 9.6 GB causing GitHub Pages deployments to fail with:Root Cause
The deploy workflow had
keep_files: truewhich preserved all existing files across deployments:This caused bloat because:
image-abc123.png)keep_files: trueExample:
Solution
keep_files: false- Do clean deployments instead of accumulating filesforce_orphan: true- Prevent git history bloat by creating fresh commitspr-preview/directory - Copy it from the current gh-pages before deploying so active PR previews aren't deletedEach deployment now produces a clean
gh-pagesbranch with only:Testing
Related
This PR was created after manually cleaning the gh-pages branch to fix the immediate deployment failure.