Skip to content

Commit

Permalink
Add script to publish storybook in docs (#1458)
Browse files Browse the repository at this point in the history
* add script to publish storybook in docs

* production is prefixed with /react

* Call it build storybook

Co-authored-by: Cole Bemis <colebemis@github.com>

* Rename deploy-storybook to build-storybook

* i'm a genius innit

was calling the wrong script

Co-authored-by: Cole Bemis <colebemis@github.com>
  • Loading branch information
siddharthkp and colebemis authored Sep 24, 2021
1 parent 52cadab commit 7c23dbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"clean": "gatsby clean",
"develop": "gatsby develop",
"build": "pushd .. && npm install && popd && cross-env NODE_ENV=production gatsby build --prefix-paths"
"build": "pushd .. && npm install && popd && cross-env NODE_ENV=production gatsby build --prefix-paths && npm run build:storybook",
"build:storybook": "cd .. && ./script/build-storybook"
},
"engines": {
"node": ">= 10.x"
Expand Down
10 changes: 10 additions & 0 deletions script/build-storybook
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Add base url to be able to serve static files
echo '<base href="/react/storybook/" />' >> .storybook/manager-head.html

# Build storybook inside docs
./node_modules/.bin/build-storybook -o docs/public/storybook -s docs/public/static

# Remove manager-head after build to not interfere with dev builds
rm .storybook/manager-head.html

0 comments on commit 7c23dbc

Please sign in to comment.