Skip to content

Commit

Permalink
add separate index file to copy
Browse files Browse the repository at this point in the history
  • Loading branch information
hussam-i-am committed Jan 12, 2025
1 parent 82e9bec commit dcfa0bb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_preview_with_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand Down
6 changes: 0 additions & 6 deletions packages/react/.storybook/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ <h1>Primer Preview Page</h1>
<div class="p-2 m-2 d-flex flex-column">
<ul class="filter-list">
<li><a class="filter-item" href="./storybook" class="btn-link mb-2">Storybook</a></li>
<li><a class="filter-item" href="./vrt-no-flag" class="btn-link mb-2">Visual Regression Testing</a></li>
<li><a class="filter-item" href="./vrt-all-flags" class="btn-link mb-2">Visual Regression Testing (All Flags
Enabled)</a></li>
<li><a class="filter-item" href="./aat-no-flag" class="btn-link mb-2">Automated Accessibility Testing</a></li>
<li><a class="filter-item" href="./aat-all-flags" class="btn-link mb-2">Automated Accessibility Testing (All Flags
Enabled)</a></li>
</ul>
</div>
</body>
Expand Down
5 changes: 4 additions & 1 deletion script/build-docs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions script/build-storybook
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dcfa0bb

Please sign in to comment.