Skip to content

Commit

Permalink
docs: ensure github pages have proper base
Browse files Browse the repository at this point in the history
  • Loading branch information
bramzijp-code committed Mar 3, 2024
1 parent c58434b commit 5c0219d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-static-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: npx nx run-many -t build -p storybook
env:
STORYBOOK_PREVIEW: true
STORYBOOK_PUBLIC_PATH: /dynamic-msw/
VITE_STORYBOOK_PUBLIC_PATH: /dynamic-msw/
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/quality-assurance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ concurrency:
cancel-in-progress: true

on:
pull_request:
push:
branches:
- main

jobs:
quality-assurance:
Expand Down
4 changes: 2 additions & 2 deletions apps/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const config: StorybookConfig = {
},
},
managerHead: (head) => {
if (!process.env.STORYBOOK_PUBLIC_PATH) return head;
return `${head}<base href="${process.env.STORYBOOK_PUBLIC_PATH}">`;
if (!process.env.VITE_STORYBOOK_PUBLIC_PATH) return head;
return `${head}<base href="${process.env.VITE_STORYBOOK_PUBLIC_PATH}">`;
},
viteFinal: (viteConfig) =>
mergeConfig(viteConfig, {
Expand Down
3 changes: 3 additions & 0 deletions apps/storybook/src/examples/ProductPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import ProductPage from './ProductPage';

const meta: Meta<typeof ProductPage> = {
component: ProductPage,
parameters: {
layout: 'fullscreen',
},
};

export default meta;
Expand Down
4 changes: 3 additions & 1 deletion apps/storybook/src/test-utils/dashboardSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ const setup = setupDashboard(
renderDashboardButton: true, // true by default
}
);
await setup.start({ onUnhandledRequest: 'bypass' });
await setup.start({
onUnhandledRequest: 'bypass',
});
1 change: 0 additions & 1 deletion apps/storybook/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ process.env.VITE_DASHBOARD_HTML = getDashboardHTML();
export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/storybook',
base: process.env.STORYBOOK_PUBLIC_PATH || '/',
server: {
port: 4200,
host: 'localhost',
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@nx/storybook:build": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["storybook"]
"inputs": ["storybook", { "runtime": "echo $VITE_STORYBOOK_PUBLIC_PATH" }]
},
"@nx/storybook:serve": {
"cache": true,
Expand Down

0 comments on commit 5c0219d

Please sign in to comment.