ci: deploy Storybook to GitHub Pages#296
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24 |
There was a problem hiding this comment.
The
setup-node step is missing cache: 'pnpm', which every other workflow in this repo includes (see ci.yml). Without it, pnpm's module store is not cached between runs, so every deploy does a full network re-download of all dependencies. Adding it keeps this workflow consistent and meaningfully cuts wall-clock time.
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/deploy-storybook.yml
Line: 37-39
Comment:
The `setup-node` step is missing `cache: 'pnpm'`, which every other workflow in this repo includes (see `ci.yml`). Without it, pnpm's module store is not cached between runs, so every deploy does a full network re-download of all dependencies. Adding it keeps this workflow consistent and meaningfully cuts wall-clock time.
```suggestion
- uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Superseded by a GitHub Pages deployment for the standalone Vite demo app. |
Summary
Deploy Storybookworkflow that buildspackages/uiStorybook and publishes it to GitHub Pages at https://youversion.github.io/platform-sdk-react/mainthat touchespackages/ui,packages/core,packages/hooks, or the lockfile; also supports manual runs viaworkflow_dispatch.STORYBOOK_YOUVERSION_APP_KEYActions secret (app keys are public app identity, not secrets) and bakes the Pages URL in asSTORYBOOK_AUTH_REDIRECT_URL.Notes
https://youversion.github.io/platform-sdk-react/as a callback URL on the Storybook app; everything else works without it.Test plan
pnpm build && pnpm build-storybookverified locally onmain(static output inpackages/ui/storybook-static/)Made with Cursor
Greptile Summary
This PR adds a GitHub Actions workflow that builds the
packages/uiStorybook and publishes it to GitHub Pages athttps://youversion.github.io/platform-sdk-react/, triggered on pushes tomainthat touch relevant packages or the lockfile.actions/upload-pages-artifactandactions/deploy-pageswith the appropriatepages: writeandid-token: writepermissions, and theconcurrencyblock prevents overlapping deployments.STORYBOOK_AUTH_REDIRECT_URLis intentionally hardcoded to the Pages URL (instead of using a secret as instorybook.yml), which is a deliberate and documented choice.setup-nodestep omitscache: 'pnpm'that every other workflow in the repo includes, causing a full dependency re-download on each deploy.Confidence Score: 4/5
Safe to merge once the one-time GitHub Pages source setting is configured in repo Settings.
The workflow is well-structured and consistent with the rest of the repo's CI patterns. The only gap is the missing pnpm cache on the setup-node step, which makes every deploy slower but does not affect correctness or security. Permissions are scoped correctly, concurrency is handled properly, and the build steps mirror what is done in other workflows.
.github/workflows/deploy-storybook.yml — the only changed file; minor cache configuration inconsistency.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant GH as GitHub (push to main) participant WF as deploy-storybook workflow participant Runner as ubuntu-latest runner participant Pages as GitHub Pages GH->>WF: push event (packages/ui, core, hooks, or lockfile) WF->>Runner: checkout + install pnpm Runner->>Runner: pnpm install --frozen-lockfile Runner->>Runner: pnpm build (all packages) Runner->>Runner: "cd packages/ui && pnpm build-storybook" Note over Runner: STORYBOOK_YOUVERSION_APP_KEY (secret)<br/>STORYBOOK_AUTH_REDIRECT_URL (hardcoded Pages URL) Runner->>Pages: upload-pages-artifact (storybook-static/) Pages-->>Runner: artifact id Runner->>Pages: deploy-pages Pages-->>WF: page_url output%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant GH as GitHub (push to main) participant WF as deploy-storybook workflow participant Runner as ubuntu-latest runner participant Pages as GitHub Pages GH->>WF: push event (packages/ui, core, hooks, or lockfile) WF->>Runner: checkout + install pnpm Runner->>Runner: pnpm install --frozen-lockfile Runner->>Runner: pnpm build (all packages) Runner->>Runner: "cd packages/ui && pnpm build-storybook" Note over Runner: STORYBOOK_YOUVERSION_APP_KEY (secret)<br/>STORYBOOK_AUTH_REDIRECT_URL (hardcoded Pages URL) Runner->>Pages: upload-pages-artifact (storybook-static/) Pages-->>Runner: artifact id Runner->>Pages: deploy-pages Pages-->>WF: page_url outputPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "ci: deploy Storybook to GitHub Pages on ..." | Re-trigger Greptile