-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(ci): prevent gh-pages branch bloat #6340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
jamadeo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks like a clean solution to reducing the bloat of old pr preview deployments.
* '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)
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.