ci(deploy): publish the React Storybook to GitHub Pages#30
Merged
Conversation
The Deploy workflow was an unfilled scaffold — it built a nonexistent `website` package under a placeholder base path. Point it at the React Storybook instead: - Build via `pnpm build-storybook` and upload `packages/react/storybook-static`. - Reuse the `ci-setup` action (git, pnpm, node from .nvmrc, frozen install). - Enable Pages from the workflow (`configure-pages enablement: true`) so the first deploy needs no manual settings toggle, and feed its `base_path` to the build. - Teach `.storybook/main.ts` to honor `BASE_PATH` via Vite's `base`, so the preview's assets resolve under the project subpath (e.g. /ui/); local dev and builds leave it unset and stay at the root. Verified locally: `BASE_PATH=/ui/ pnpm build-storybook` emits iframe assets at /ui/assets/… while the manager keeps relative refs, which is what resolves correctly on a Pages project site. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The
Deployworkflow was an unfilled scaffold — it built a nonexistentwebsitepackage under a/TODO-set-base-path/placeholder, so nothing ever deployed. This points it at the React Storybook and ships it to GitHub Pages.Changes
pnpm build-storybookand uploadpackages/react/storybook-static../.github/actions/ci-setupfor the build job (git, pnpm, node from.nvmrc, frozen install) instead of hand-rolled setup steps.actions/configure-pageswithenablement: true) so the first deploy doesn't require a manual toggle in repo settings, and feed itsbase_pathoutput into the build..storybook/main.ts→viteFinalsets VitebasefromBASE_PATH). The project site is served under/<repo>/(e.g.https://dunky-dev.github.io/ui/), so the preview's assets must resolve there. Localpnpm dev/build-storybookleaveBASE_PATHunset and stay at the root — no change to the local workflow.Verification
BASE_PATH=/ui/ pnpm build-storybooklocally:iframe.html(Vite preview) →src="/ui/assets/iframe-*.js"— base applied ✓index.html(manager) → relative refs (./sb-manager/…,./favicon.svg) that resolve under any subpath ✓packages/react/storybook-static✓That manager-relative + preview-based combination is what resolves correctly on a Pages project site.
Note
Pages has never been enabled on this repo (the API returns 404).
enablement: truehandles that on the first run; if org policy blocks programmatic enablement, it may need a one-time Settings → Pages → Source: GitHub Actions toggle. Deploy runs on push tomain(andworkflow_dispatch).🤖 Generated with Claude Code