File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Build and Publish storybook to GitHub Pages
1+ # Deploys Storybook via GitHub Actions (no Jekyll). In repo Settings → Pages, set Source to "GitHub Actions".
2+ name : Build and Publish Storybook to GitHub Pages
23
34on :
45 push :
56 branches : [main]
67
78permissions :
8- contents : write # push to gh-pages-storybook branch
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : pages
15+ cancel-in-progress : false
916
1017jobs :
11- build-and-deploy-storybook :
18+ build :
1219 runs-on : ubuntu-latest
1320 steps :
14- - name : Checkout 🛎️
21+ - name : Checkout
1522 uses : actions/checkout@v4
16- with :
17- fetch-depth : 0
1823 - uses : pnpm/action-setup@v4
1924 with :
2025 version : 10.27.0
2126 - uses : actions/setup-node@v4
2227 with :
2328 node-version : 22
2429 cache : ' pnpm'
25- - name : Install and Build 🔧
30+ - name : Install and Build Storybook
2631 run : |
2732 pnpm install --frozen-lockfile
2833 pnpm run build:storybook
29- - name : Add .nojekyll file to static folder 📁
30- run :
31- | # Add .nojekyll file to the static folder to prevent 404 errors (files with _ prefix are not copied to the static folder)
32- touch storybook-static/.nojekyll
33- - name : Deploy 🚀
34- uses : JamesIves/github-pages-deploy-action@v4
34+ - name : Add .nojekyll
35+ run : touch storybook-static/.nojekyll
36+ - name : Upload Storybook artifact
37+ uses : actions/upload-pages-artifact@v3
3538 with :
36- branch : gh-pages-storybook
37- folder : storybook-static
38- clean : true
39+ path : storybook-static
40+
41+ deploy :
42+ needs : build
43+ runs-on : ubuntu-latest
44+ environment :
45+ name : github-pages
46+ url : ${{ steps.deploy.outputs.page_url }}
47+ steps :
48+ - name : Deploy to GitHub Pages
49+ id : deploy
50+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 11{
2- "buildCommand" : " pnpm run build- storybook" ,
2+ "buildCommand" : " pnpm run build: storybook" ,
33 "outputDirectory" : " storybook-static" ,
44 "framework" : null
55}
You can’t perform that action at this time.
0 commit comments