From 7c23dbc2fb2095b5f3b1b655cc655ca49cd70dd5 Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Fri, 24 Sep 2021 11:59:27 +0200 Subject: [PATCH] Add script to publish storybook in docs (#1458) * add script to publish storybook in docs * production is prefixed with /react * Call it build storybook Co-authored-by: Cole Bemis * Rename deploy-storybook to build-storybook * i'm a genius innit was calling the wrong script Co-authored-by: Cole Bemis --- docs/package.json | 3 ++- script/build-storybook | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 script/build-storybook diff --git a/docs/package.json b/docs/package.json index 39ae2f04221..bc9fe493aca 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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" diff --git a/script/build-storybook b/script/build-storybook new file mode 100755 index 00000000000..995debd35ae --- /dev/null +++ b/script/build-storybook @@ -0,0 +1,10 @@ +#!/bin/bash + +# Add base url to be able to serve static files +echo '' >> .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