Skip to content

Commit de4f246

Browse files
committed
Add GitHub Actions workflow for deploying Storybook to GitHub Pages
1 parent 31c53b2 commit de4f246

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: npm
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build Storybook
35+
run: npx storybook build --base-path /ui-kit --output-dir ./storybook-static
36+
37+
- uses: actions/configure-pages@v5
38+
39+
- uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: storybook-static
42+
43+
- name: Deploy
44+
id: deployment
45+
uses: actions/deploy-pages@v4

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
"version": "0.1.0",
44
"description": "HackLM design system — all components, tokens, and patterns in one place.",
55
"type": "module",
6+
"homepage": "https://hacklmdev.github.io/ui-kit",
67
"scripts": {
78
"storybook": "storybook dev -p 6006",
89
"build-storybook": "storybook build",
9-
"typecheck": "tsc --noEmit"
10+
"typecheck": "tsc --noEmit",
11+
"build": "vite build",
12+
"predeploy": "storybook build --base-path /ui-kit --output-dir ./storybook-static",
13+
"deploy": "gh-pages -d storybook-static"
1014
},
1115
"devDependencies": {
1216
"@chromatic-com/storybook": "^5.0.1",
@@ -21,7 +25,8 @@
2125
"storybook": "^10.2.13",
2226
"tailwindcss": "^4.2.1",
2327
"typescript": "^5.9.3",
24-
"vite": "^7.3.1"
28+
"vite": "^7.3.1",
29+
"gh-pages": "^5.0.0"
2530
},
2631
"dependencies": {
2732
"lucide-react": "^0.575.0",

0 commit comments

Comments
 (0)