From 8b965914f9afee2a6040d2ef3d4bfba2a7f752e6 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Mon, 13 Jan 2025 12:28:34 -0500 Subject: [PATCH] Fix Prod Storybook deployment (#5535) * Fix prod storybook deployment * Add npm scripts --- package.json | 2 ++ script/build-docs | 4 ++-- script/build-storybook | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0376fdbd823..b62341b4f8b 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "start": "concurrently npm:start:*", "start:storybook": "npm run start:storybook -w @primer/react", "build:storybook": "script/build-storybook", + "build:storybook:preview": "script/build-storybook preview", + "build:storybook:preview_with_reports": "script/build-storybook preview_with_reports", "build:docs": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs", "build:docs:preview": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview", "build:docs:preview_with_reports": "NODE_OPTIONS=--openssl-legacy-provider script/build-docs preview_with_reports", diff --git a/script/build-docs b/script/build-docs index f9818e35bf8..73f6cb2103d 100755 --- a/script/build-docs +++ b/script/build-docs @@ -3,10 +3,10 @@ set -e if [ "$1" == "preview" ]; then export DEPLOY_ENV="preview" - npm run build:storybook preview + npm run build:storybook:preview elif [ "$1" == "preview_with_reports" ]; then export DEPLOY_ENV="preview" - npm run build:storybook preview_with_reports + npm run build:storybook:preview_with_reports else export DEPLOY_ENV="production" npm run build:storybook diff --git a/script/build-storybook b/script/build-storybook index 58313730b73..7f9efa3242f 100755 --- a/script/build-storybook +++ b/script/build-storybook @@ -16,7 +16,7 @@ npx storybook build -o ../../docs/public/storybook if [ "$1" == "preview_with_reports" ]; then # Move index_with_reports.html to the right location cp .storybook/index_with_reports.html ../../docs/public/index.html -else +elif [ "$1" == "preview" ]; then # Move index.html to the right location cp .storybook/index.html ../../docs/public/index.html fi