Repository navigation
fix(ci): add stable storybook/ path + protect latest deploy from cleanup - #755
rubyycheung wants to merge 2 commits into
Conversation
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
left a comment
There was a problem hiding this comment.
The stable storybook/ and sandbox/ paths in deploy.yml — that's the real fix, and it's clean. Links to /storybook/index.html?path=... will survive cleanup forever. 👍
The cleanup workflow changes (reading the latest file and protecting that hash) should be removed though. The existing LATEST_DEPLOYED logic already does this — it finds the most recently deployed hash dir via git log on the gh-pages branch, which is strictly more reliable than reading the latest file. They'll almost always point to the same dir, and when they diverge, the git-log approach wins because it reflects what's actually on gh-pages rather than what a file claims.
Removing those two blocks from cleanup-previews.yml keeps this PR focused on the thing that actually matters: the stable paths.
— Navi (on behalf of @cixzhang)
|
One more note on the deploy gap: the PR description mentions links breaking when hash directories get cleaned up, and the But there's a subtler issue worth calling out — the ~60s gap between when This isn't something we can solve at the workflow layer. GitHub Pages doesn't expose a deploy-complete hook or status API. So don't try to engineer around it — the stable path already gives you the right tradeoff: the link always works, and the content is at most one deploy behind. — Navi (on behalf of @cixzhang) |
|
Good call — removed the cleanup-previews.yml changes. The existing |
|
lg2m i don't see it causing any issues |
Two changes: 1. Deploy workflow now also copies the Storybook build to a stable storybook/ directory. Links like .../storybook/index.html?path=... will always work regardless of hash directory cleanup. 2. Cleanup workflow now reads the latest file and protects that hash from deletion — prevents the race where main HEAD advances but the previous deploy gets cleaned up before the new one lands.
The existing LATEST_DEPLOYED git-log logic already handles protecting the most recent deploy. Keeping this PR focused on the stable storybook/ path.
dd7aeb6 to
a84a8be
Compare
Pull request was closed
Problem
Storybook links in shared docs keep breaking because:
<hash>/directorieslatestfile hash and the current main HEAD can diverge, so cleanup doesn't protect the right directoryThis means any direct link like
.../865f2dc/index.html?path=/docs/...stops working within days.Fix
Deploy workflow: Also copies the Storybook build to a stable
storybook/directory. Links likestudious-broccoli-o7e61n3.pages.github.io/storybook/index.html?path=/docs/core-xdsbutton--docswill always work regardless of cleanup.Cleanup workflow: Now reads the
latestfile and protects that hash from deletion — prevents the race where main HEAD advances but the previous deploy gets cleaned up before the new one lands.After merge
Shared doc links can use
/storybook/instead of/<hash>/and they'll never break again.