Skip to content

Commit dc7805b

Browse files
committed
gh pages?
1 parent c25bd79 commit dc7805b

File tree

4 files changed

+69
-17
lines changed

4 files changed

+69
-17
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Workflow name
2+
name: Build and Publish Storybook to GitHub Pages
3+
4+
on:
5+
# Event for the workflow to run on
6+
push:
7+
branches:
8+
- 'storybook-resurrect' # Replace with the branch you want to deploy from
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# List of jobs
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
# Job steps
20+
steps:
21+
# Manual Checkout
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
# Set up Node
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
30+
- uses: bitovi/[email protected]
31+
with:
32+
install_command: yarn install # default: npm ci
33+
build_command: yarn build-storybook # default: npm run build-storybook
34+
path: storybook-static # default: dist/storybook
35+
checkout: false # default: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ yarn-error.log*
3232
sh.exe.stackdump
3333
/dist
3434
/.vscode
35+
36+
*storybook.log
37+
storybook-static

.storybook/main.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
module.exports = {
2-
core: {
3-
builder: 'webpack5',
4-
},
5-
stories: ['../src/**/*.stories.@(js|mdx)'],
6-
addons: [
7-
{
8-
name: '@storybook/addon-docs',
9-
options: {
10-
configureJSX: true,
11-
babelOptions: {},
12-
sourceLoaderOptions: null
13-
}
14-
},
15-
'@storybook/addon-essentials',
16-
'@storybook/addon-actions'
17-
]
1+
2+
3+
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
4+
const config = {
5+
"stories": [
6+
"../src/**/*.mdx",
7+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
8+
],
9+
"addons": [
10+
"@storybook/addon-webpack5-compiler-swc",
11+
"@storybook/addon-docs",
12+
"@storybook/addon-onboarding"
13+
],
14+
"framework": {
15+
"name": "@storybook/react-webpack5",
16+
"options": {}
17+
}
1818
};
19+
export default config;

.storybook/preview.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type { import('@storybook/react-webpack5').Preview } */
2+
const preview = {
3+
parameters: {
4+
controls: {
5+
matchers: {
6+
color: /(background|color)$/i,
7+
date: /Date$/i,
8+
},
9+
},
10+
},
11+
};
12+
13+
export default preview;

0 commit comments

Comments
 (0)