Skip to content

Commit e049f8c

Browse files
committed
chore: fix storybook caching and change output paths of targets
1 parent b09723e commit e049f8c

File tree

6 files changed

+19
-6
lines changed

6 files changed

+19
-6
lines changed

.github/workflows/docsite-publish-ghpages.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,25 @@ jobs:
3939
- name: Build affected storybooks
4040
if: steps.affected_storybooks_count.outputs.value > 0
4141
run: |
42-
yarn nx run public-docsite-v9:build-storybook
4342
yarn nx run-many -t build-storybook:docsite --nxBail
4443
44+
- name: Prepare Artifact
45+
if: steps.affected_storybooks_count.outputs.value > 0
46+
run: |
47+
rm -rf _pages
48+
mkdir -p _pages/react _pages/charts _pages/web-components
49+
50+
cp -R apps/public-docsite-v9/dist/storybook/* _pages/
51+
cp -R apps/public-docsite-v9/dist/react/* _pages/react/
52+
cp -R apps/chart-docsite/dist/storybook/* _pages/charts/
53+
cp -R packages/web-components/dist/storybook/* _pages/web-components
54+
4555
- name: Upload Pages Artifact
4656
if: steps.affected_storybooks_count.outputs.value > 0
4757
id: artifact_upload
4858
uses: actions/upload-pages-artifact@v3
4959
with:
50-
path: './apps/public-docsite-v9/dist/'
60+
path: _pages
5161

5262
deploy:
5363
runs-on: ubuntu-latest

apps/chart-docsite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"description": "Fluent UI React Charts Preview documentation",
66
"scripts": {
77
"build-storybook": "storybook build -o ./dist/storybook --docs",
8-
"build-storybook:docsite": "cross-env DEPLOY_PATH=/charts/ storybook build -o ../public-docsite-v9/dist/charts/ --docs",
9-
"postbuild-storybook": "yarn rewrite-title",
8+
"build-storybook:docsite": "cross-env DEPLOY_PATH=/charts/ storybook build -o ./dist/storybook --docs",
9+
"postbuild-storybook": "yarn rewrite-title && yarn generate-llms-docs",
1010
"rewrite-title": "node -r ../../scripts/ts-node/src/register ../../scripts/storybook/src/scripts/rewrite-title.ts --title 'Fluent UI Charts v9' --distPath ./dist/storybook",
1111
"generate-llms-docs": "yarn storybook-llms-extractor --distPath ./dist/storybook --summaryBaseUrl \"https://fluentuipr.z22.web.core.windows.net/pull/34838/chart-docsite/storybook\" --summaryTitle \"Fluent UI Charts v9\" --summaryDescription \"Fluent UI React charts is a set of modern, accessible, interactive, lightweight and highly customizable visualization library representing the Microsoft design system. These charts are used across 100s of projects inside Microsoft across Microsoft 365, Copilot and Azure.\"",
1212
"clean": "just-scripts clean",

apps/public-docsite-v9/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"description": "Fluent UI React v9 documentation",
66
"scripts": {
7-
"build-storybook": "cross-env NODE_OPTIONS=--max_old_space_size=3072 storybook build -o ./dist/ --docs",
7+
"build-storybook": "cross-env NODE_OPTIONS=--max_old_space_size=3072 storybook build -o ./dist/storybook --docs",
88
"build-storybook:react": "cross-env NODE_OPTIONS=--max_old_space_size=3072 DEPLOY_PATH=/react/ storybook build -o ./dist/react --docs",
99
"postbuild-storybook": "yarn rewrite-title",
1010
"rewrite-title": "node -r ../../scripts/ts-node/src/register ../../scripts/storybook/src/scripts/rewrite-title.ts --title 'Fluent UI React v9' --distPath ./dist/",

apps/public-docsite-v9/project.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"tags": ["platform:web", "vNext"],
77
"targets": {
88
"build-storybook": {
9+
"outputs": ["{projectRoot}/dist/"],
910
"dependsOn": [
1011
{
1112
"projects": ["react-storybook-addon", "react-storybook-addon-export-to-sandbox", "storybook-llms-extractor"],
@@ -16,6 +17,7 @@
1617
"build-storybook:docsite": {
1718
"executor": "nx:noop",
1819
"dependsOn": [
20+
"build-storybook",
1921
"build-storybook:react",
2022
{
2123
"projects": ["chart-docsite", "web-components"],

nx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"build-storybook": {
2222
"dependsOn": [],
23+
"outputs": ["{projectRoot}/dist/storybook"],
2324
"inputs": ["default", "{workspaceRoot}/.storybook/**", "{projectRoot}/.storybook/**"],
2425
"cache": true
2526
},

packages/web-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"start": "yarn start-storybook -p 6006 --docs",
6666
"start-storybook": "storybook dev",
6767
"build-storybook": "storybook build -o ./dist/storybook --docs",
68-
"build-storybook:docsite": "cross-env DEPLOY_PATH=/web-components/ storybook build -o ../../apps/public-docsite-v9/dist/web-components --docs",
68+
"build-storybook:docsite": "cross-env DEPLOY_PATH=/web-components/ storybook build -o ./dist/storybook --docs",
6969
"e2e": "node ./scripts/e2e.js",
7070
"e2e:local": "node ./scripts/e2e.js --ui"
7171
},

0 commit comments

Comments
 (0)