Skip to content

Commit 70f3eb2

Browse files
committed
ci(storybook): add deploy workflow for Storybook to gh-pages
1 parent a380b16 commit 70f3eb2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build Storybook
27+
run: npm run build-storybook
28+
29+
- name: Deploy to GitHub Pages
30+
uses: peaceiris/actions-gh-pages@v4
31+
with:
32+
publish_dir: ./storybook-static
33+
# Use the GitHub token provided by Actions
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_branch: gh-pages
36+
keep_files: false
37+
allow_empty_commit: false

0 commit comments

Comments
 (0)