Repository navigation
fix(deploy): clean deploys, PR previews at /pr/<number>/, stable sandbox URL - #916
Merged
Merged
Conversation
…box URL Three workflow changes that fix gh-pages bloat and broken sandbox URLs: **deploy.yml — clean deploys (keep_files:false)** - Switch from keep_files:true to keep_files:false — each deploy is a clean slate instead of accumulating stale content-hashed assets forever - Preserve /pr/ and /reports/ dirs by cloning gh-pages before deploying - Build sandbox with basePath=/sandbox (stable, self-contained URL) - Landing page links directly to /storybook/ and /sandbox/ (no JS resolution needed, no dependency on hash dirs) - Remove hash-versioned main deploy (/<hash>/) entirely — stable paths are the canonical URLs now **ci.yml — PR previews at /pr/<number>/** - Deploy PR previews to /pr/<number>/ instead of /<commit-hash>/ - Cleaner namespace: easy to identify, easy to clean up - PR preview URLs in comments now use /pr/<number>/ paths **cleanup-previews.yml — simplified cleanup** - Delete /pr/<number>/ dirs for closed PRs (simple number match vs API) - Delete all legacy 7-char hex directories (one-time migration) - No longer deletes /sandbox/ (was being nuked daily by old cleanup!) - No more complex hash-dir retention logic (main HEAD, latest deployed) Fixes: storybook/ had 2,656 accumulated files (vs ~192 per build, 14x bloat). sandbox/ was deleted daily by cleanup then recreated by deploy with wrong basePath. Both issues are resolved.
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
…box URL (#916) Three workflow changes that fix gh-pages bloat and broken sandbox URLs: **deploy.yml — clean deploys (keep_files:false)** - Switch from keep_files:true to keep_files:false — each deploy is a clean slate instead of accumulating stale content-hashed assets forever - Preserve /pr/ and /reports/ dirs by cloning gh-pages before deploying - Build sandbox with basePath=/sandbox (stable, self-contained URL) - Landing page links directly to /storybook/ and /sandbox/ (no JS resolution needed, no dependency on hash dirs) - Remove hash-versioned main deploy (/<hash>/) entirely — stable paths are the canonical URLs now **ci.yml — PR previews at /pr/<number>/** - Deploy PR previews to /pr/<number>/ instead of /<commit-hash>/ - Cleaner namespace: easy to identify, easy to clean up - PR preview URLs in comments now use /pr/<number>/ paths **cleanup-previews.yml — simplified cleanup** - Delete /pr/<number>/ dirs for closed PRs (simple number match vs API) - Delete all legacy 7-char hex directories (one-time migration) - No longer deletes /sandbox/ (was being nuked daily by old cleanup!) - No more complex hash-dir retention logic (main HEAD, latest deployed) Fixes: storybook/ had 2,656 accumulated files (vs ~192 per build, 14x bloat). sandbox/ was deleted daily by cleanup then recreated by deploy with wrong basePath. Both issues are resolved.
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…box URL (#916) Three workflow changes that fix gh-pages bloat and broken sandbox URLs: **deploy.yml — clean deploys (keep_files:false)** - Switch from keep_files:true to keep_files:false — each deploy is a clean slate instead of accumulating stale content-hashed assets forever - Preserve /pr/ and /reports/ dirs by cloning gh-pages before deploying - Build sandbox with basePath=/sandbox (stable, self-contained URL) - Landing page links directly to /storybook/ and /sandbox/ (no JS resolution needed, no dependency on hash dirs) - Remove hash-versioned main deploy (/<hash>/) entirely — stable paths are the canonical URLs now **ci.yml — PR previews at /pr/<number>/** - Deploy PR previews to /pr/<number>/ instead of /<commit-hash>/ - Cleaner namespace: easy to identify, easy to clean up - PR preview URLs in comments now use /pr/<number>/ paths **cleanup-previews.yml — simplified cleanup** - Delete /pr/<number>/ dirs for closed PRs (simple number match vs API) - Delete all legacy 7-char hex directories (one-time migration) - No longer deletes /sandbox/ (was being nuked daily by old cleanup!) - No more complex hash-dir retention logic (main HEAD, latest deployed) Fixes: storybook/ had 2,656 accumulated files (vs ~192 per build, 14x bloat). sandbox/ was deleted daily by cleanup then recreated by deploy with wrong basePath. Both issues are resolved.
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
…box URL (#916) Three workflow changes that fix gh-pages bloat and broken sandbox URLs: **deploy.yml — clean deploys (keep_files:false)** - Switch from keep_files:true to keep_files:false — each deploy is a clean slate instead of accumulating stale content-hashed assets forever - Preserve /pr/ and /reports/ dirs by cloning gh-pages before deploying - Build sandbox with basePath=/sandbox (stable, self-contained URL) - Landing page links directly to /storybook/ and /sandbox/ (no JS resolution needed, no dependency on hash dirs) - Remove hash-versioned main deploy (/<hash>/) entirely — stable paths are the canonical URLs now **ci.yml — PR previews at /pr/<number>/** - Deploy PR previews to /pr/<number>/ instead of /<commit-hash>/ - Cleaner namespace: easy to identify, easy to clean up - PR preview URLs in comments now use /pr/<number>/ paths **cleanup-previews.yml — simplified cleanup** - Delete /pr/<number>/ dirs for closed PRs (simple number match vs API) - Delete all legacy 7-char hex directories (one-time migration) - No longer deletes /sandbox/ (was being nuked daily by old cleanup!) - No more complex hash-dir retention logic (main HEAD, latest deployed) Fixes: storybook/ had 2,656 accumulated files (vs ~192 per build, 14x bloat). sandbox/ was deleted daily by cleanup then recreated by deploy with wrong basePath. Both issues are resolved.
cixzhang
added a commit
that referenced
this pull request
Aug 5, 2026
…an commit (#4718) Every push to main has had its Deploy job cancelled for ~a day (15-min job timeout). The deploy job cloned all of gh-pages and `cp -r`'d the entire /pr/ tree forward on every push. With ~52 live previews (>1GB, ~40k files) the clone + two copies blew the 15-min budget before the publish step ever ran. The cost was O(all live previews) per deploy — a full local copy of the tree was required because peaceiris `force_orphan:true` publishes whatever is in publish_dir. Fix: build the single orphan commit ourselves and reuse /pr/ & /reports/ by SHA instead of copying them: - --filter=blob:none + sparse-checkout materializes ONLY the stable paths (storybook/ sandbox/ assets/ + root files). /pr/ & /reports/ (the >1GB of preview blobs) are never fetched or written — they stay in the index as skip-worktree entries. - clean-replace the stable paths so superseded content-hashed assets don't accumulate (keeps what keep_files:false originally fixed, #916). - git write-tree rebuilds the full tree from the index (pr/ & reports/ reused by SHA); git commit-tree with no parent produces a single orphan commit — the same clean-slate history force_orphan gave us (#2239/#2238), now without a full local copy of gh-pages. - push with --force-with-lease + retry to stay safe against concurrent gh-pages writers (other main deploys, PR-preview pushes). Deploy time is now O(1) in preview count. compact-gh-pages.yml stays as the weekly history backstop. Note: deploy-preview.yml still full-clones gh-pages per preview push (same root pattern, not yet at the timeout) — worth the same treatment as a follow-up.
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
Three issues with the current gh-pages deploy:
storybook/has 2,656 accumulated files (vs ~192 per build — 14x bloat).keep_files: truemeans old content-hashed chunks are never removed./sandbox/is deleted daily by the cleanup workflow then recreated by deploy with the wrongbasePath. It was listed as a "stale root-level item" alongside old Storybook files likefavicon.svg.PR preview dirs use commit hashes (
/<7-char-hex>/) which are hard to identify and require GitHub API calls to match to PRs during cleanup.Solution
deploy.yml— switch tokeep_files: falseEach deploy is now a clean slate. Before deploying, the workflow clones gh-pages and preserves
/pr/and/reports/dirs, then copies them into the freshdeploy/directory.basePath=/sandbox(stable, self-contained URL)storybook/index.htmlandsandbox/index.html— no JS resolution needed/<hash>/) — stable paths are the canonical URLsci.yml— PR previews at/pr/<number>/PR previews now deploy to
/pr/<number>/instead of/<commit-hash>/. Benefits:cleanup-previews.yml— simplified/pr/<number>/dirs for closed/merged PRs/sandbox/— it's no longer stale, it's a stable deploy targetgh-pages layout after this PR
Supersedes most of #913 (that PR can be narrowed to just the
BuildStatuscomponent if still wanted).