1- # Workflow name
21name : Build and Publish Storybook to GitHub Pages
32
43on :
5- # Event for the workflow to run on
64 push :
75 branches :
86 - ' main' # Replace with the branch you want to deploy from
@@ -12,29 +10,47 @@ permissions:
1210 pages : write
1311 id-token : write
1412
15- # List of jobs
1613jobs :
1714 deploy :
1815 runs-on : ubuntu-latest
19- # Job steps
2016 steps :
21- # Manual Checkout
22- - uses : actions/checkout@v4
17+ # Checkout the repository
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
2320
2421 # Set up Node
25- - uses : actions/setup-node@v4
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
2624 with :
2725 node-version : ' 20.x'
2826
2927 # Install pnpm
30- - uses : pnpm/action-setup@v4
28+ - name : Setup pnpm
29+ uses : pnpm/action-setup@v4
3130 with :
3231 version : 9
3332
34- # 👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
35- 33+ # Install dependencies
34+ - name : Install dependencies
35+ run : |
36+ cd example
37+ pnpm install --frozen-lockfile
38+
39+ # Build Storybook
40+ - name : Build Storybook
41+ run : |
42+ cd example
43+ pnpm build
44+
45+ # List files in the build directory for debugging
46+ - name : List build directory contents
47+ run : |
48+ cd example
49+ ls -la storybook-static
50+
51+ # Deploy to GitHub Pages
52+ - name : Deploy to GitHub Pages
53+ 3654 with :
37- install_command : cd example && pnpm install --frozen-lockfile # default: npm ci
38- build_command : cd example && pnpm build # default: npm run build-storybook
39- path : storybook-static # default: storybook-static
40- checkout : false # default: true
55+ path : example/storybook-static
56+ checkout : false
0 commit comments