diff --git a/.github/workflows/deploy_preview_with_reports.yml b/.github/workflows/deploy_preview_with_reports.yml index cbf3b7645d7..196c9463d65 100644 --- a/.github/workflows/deploy_preview_with_reports.yml +++ b/.github/workflows/deploy_preview_with_reports.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: npm ci - name: Build docs preview - run: npm run build:docs:preview + run: npm run build:docs:preview_with_reports - name: Download VRT reports (All flags enabled) uses: actions/download-artifact@v4 with: diff --git a/package.json b/package.json index f692fa9ec01..0376fdbd823 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "build:storybook": "script/build-storybook", "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", "build:components.json": "npm run build:components.json -w @primer/react", "lint": "eslint '**/*.{js,ts,tsx,md,mdx}' --max-warnings=0", "lint:css": "stylelint --rd -q '**/*.css'", diff --git a/packages/react/.storybook/index.html b/packages/react/.storybook/index.html index 9bedaec25db..6bc4c385977 100644 --- a/packages/react/.storybook/index.html +++ b/packages/react/.storybook/index.html @@ -13,12 +13,6 @@

Primer Preview Page

diff --git a/script/build-docs b/script/build-docs index 5e88f91a525..3671eba1822 100755 --- a/script/build-docs +++ b/script/build-docs @@ -1,9 +1,12 @@ #!/bin/bash set -e -if [ -n "$1" ]; then +if [ "$1" == "preview" ]; then export DEPLOY_ENV="preview" npm run build:storybook preview +elseif [ "$1" == "preview_with_reports" ]; then + export DEPLOY_ENV="preview" + 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 457aeb77f48..9b164d4480f 100755 --- a/script/build-storybook +++ b/script/build-storybook @@ -13,8 +13,13 @@ fi # Build storybook inside docs npx storybook build -o ../../docs/public/storybook -# Move index page to the right location -cp .storybook/index.html ../../docs/public/index.html +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 + # Move index.html to the right location + cp .storybook/index.html ../../docs/public/index.html +fi # Remove manager-head after build to not interfere with dev builds rm .storybook/manager-head.html