Skip to content

Commit b8ee32a

Browse files
committed
chore(ci): update build command and enhance GitHub Actions workflow for Storybook deployment
1 parent 80a6bb4 commit b8ee32a

2 files changed

Lines changed: 29 additions & 17 deletions

File tree

.github/workflows/storybook.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
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

34
on:
45
push:
56
branches: [main]
67

78
permissions:
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

1017
jobs:
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

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"buildCommand": "pnpm run build-storybook",
2+
"buildCommand": "pnpm run build:storybook",
33
"outputDirectory": "storybook-static",
44
"framework": null
55
}

0 commit comments

Comments
 (0)