Skip to content

Commit 8b96591

Browse files
authored
Fix Prod Storybook deployment (#5535)
* Fix prod storybook deployment * Add npm scripts
1 parent be42cc6 commit 8b96591

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"start": "concurrently npm:start:*",
1717
"start:storybook": "npm run start:storybook -w @primer/react",
1818
"build:storybook": "script/build-storybook",
19+
"build:storybook:preview": "script/build-storybook preview",
20+
"build:storybook:preview_with_reports": "script/build-storybook preview_with_reports",
1921
"build:docs": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs",
2022
"build:docs:preview": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview",
2123
"build:docs:preview_with_reports": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview_with_reports",

script/build-docs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ set -e
33

44
if [ "$1" == "preview" ]; then
55
export DEPLOY_ENV="preview"
6-
npm run build:storybook preview
6+
npm run build:storybook:preview
77
elif [ "$1" == "preview_with_reports" ]; then
88
export DEPLOY_ENV="preview"
9-
npm run build:storybook preview_with_reports
9+
npm run build:storybook:preview_with_reports
1010
else
1111
export DEPLOY_ENV="production"
1212
npm run build:storybook

script/build-storybook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ npx storybook build -o ../../docs/public/storybook
1616
if [ "$1" == "preview_with_reports" ]; then
1717
# Move index_with_reports.html to the right location
1818
cp .storybook/index_with_reports.html ../../docs/public/index.html
19-
else
19+
elif [ "$1" == "preview" ]; then
2020
# Move index.html to the right location
2121
cp .storybook/index.html ../../docs/public/index.html
2222
fi

0 commit comments

Comments
 (0)