-
Notifications
You must be signed in to change notification settings - Fork 1
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
Build and Upload Storybook in Github Workflows #504
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #504 +/- ##
==========================================
- Coverage 43.22% 43.21% -0.01%
==========================================
Files 363 363
Lines 11102 11102
Branches 1809 1809
==========================================
- Hits 4799 4798 -1
- Misses 6141 6142 +1
Partials 162 162 ☔ View full report in Codecov by Sentry. |
build-storybook: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node_modules- | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build Storybook | ||
run: npm run build-storybook | ||
|
||
- name: Archive `storybook-static` | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: storybook | ||
path: storybook-static | ||
|
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.
I'd recommend factoring this (and the build
job) into their own files and invoking them from each of the deploy actions via
jobs:
build:
uses: ./.github/workflows/build.yml
It looks to me like the artifact upload/download will just continue to work in that case, though I haven't tested this myself.
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.
Confirmed that this does work, and I think it's up to you whether you want to factor out the build jobs here or leave that for the potholes sprint.
I'll merge this now and refactor it during the Potholes sprint since it seems a bit involved (and multiple open PRs have edits to the workflows right now and I'd prefer to merge these changes as soon as possible) |
To make Storybook easier to access for non-developers, we want to build a static version of it that gets deployed to each environment. This requires building a copy of Storybook alongside the main production build and then uploading that static Storybook directory as well. This is done by creating a new `build-storybook` step. Both Storybook and the main production build are uploaded in the `upload-code` step. Also update .gitignore to ignore the statically built Storybook directory. PER-9925: Build Storybook as part of web-app build process
747c730
to
7916e6c
Compare
To make Storybook easier to access for non-developers, we want to build a static version of it that gets deployed to each environment. This requires building a copy of Storybook alongside the main production build and then uploading that static Storybook directory as well. This is done by creating a new
build-storybook
step. Both Storybook and the main production build are uploaded in theupload-code
step.Also update .gitignore to ignore the statically built Storybook directory.
Steps to test:
/data/www/mdot
contains astorybook
directory alongside its usualdist
directory.storybook
directory has built HTML/JavaScript files in it.This does not need any QA.