Skip to content

Commit 8b28110

Browse files
author
Ky Decker
authored
Update Storybook workflow to verify build before merge (#441)
1 parent f6b8261 commit 8b28110

3 files changed

Lines changed: 128 additions & 140 deletions

File tree

.github/workflows/storybook.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Storybook
22

33
on:
4+
pull_request:
5+
branches: [main]
46
push:
57
branches: [main]
68
workflow_dispatch:
@@ -10,13 +12,19 @@ permissions:
1012
pages: write
1113
id-token: write
1214

15+
concurrency:
16+
group: pages
17+
cancel-in-progress: false
18+
1319
jobs:
14-
deploy:
15-
name: Deploy
20+
build:
21+
name: Build
1622
runs-on: ubuntu-latest
1723
steps:
1824
- name: Checkout
1925
uses: actions/checkout@v6
26+
with:
27+
fetch-depth: 0
2028

2129
- name: Setup PNPM
2230
uses: pnpm/action-setup@v5
@@ -27,10 +35,29 @@ jobs:
2735
node-version: "24.x"
2836
cache: "pnpm"
2937

30-
- name: Deploy to GitHub Pages
31-
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.4
38+
- name: Install dependencies
39+
run: pnpm install
40+
41+
- name: Build Storybook
42+
run: pnpm storybook:build
43+
44+
- name: Upload Pages artifact
45+
if: github.event_name != 'pull_request'
46+
uses: actions/upload-pages-artifact@v3
3247
with:
33-
install_command: pnpm install
34-
build_command: pnpm storybook:build
3548
path: storybook-static
36-
checkout: false
49+
50+
deploy:
51+
name: Deploy
52+
needs: build
53+
if: github.event_name != 'pull_request'
54+
runs-on: ubuntu-latest
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deploy.outputs.page_url }}
58+
steps:
59+
- id: deploy
60+
name: Deploy to GitHub Pages
61+
uses: actions/deploy-pages@v4
62+
with:
63+
token: ${{ github.token }}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@
9494
"@csstools/postcss-logical-viewport-units": "^4.0.0",
9595
"@playwright/test": "^1.59.0",
9696
"@react-aria/test-utils": "1.0.0-beta.2",
97-
"@storybook/addon-links": "^10.3.3",
98-
"@storybook/addon-themes": "^10.3.3",
99-
"@storybook/addon-vitest": "^10.3.3",
100-
"@storybook/builder-vite": "^10.3.3",
101-
"@storybook/react": "^10.3.3",
102-
"@storybook/react-vite": "^10.3.3",
97+
"@storybook/addon-links": "^10.2.19",
98+
"@storybook/addon-themes": "^10.2.19",
99+
"@storybook/addon-vitest": "^10.2.19",
100+
"@storybook/builder-vite": "^10.2.19",
101+
"@storybook/react": "^10.2.19",
102+
"@storybook/react-vite": "^10.2.19",
103103
"@testing-library/dom": "^10.4.1",
104104
"@testing-library/jest-dom": "^6.9.1",
105105
"@testing-library/react": "^16.3.2",
@@ -114,7 +114,7 @@
114114
"@types/sanitize-html": "^2.16.1",
115115
"@types/topojson-client": "^3.1.5",
116116
"@types/topojson-specification": "^1.0.5",
117-
"@vitest/coverage-v8": "4.0.18",
117+
"@vitest/coverage-v8": "4.1.2",
118118
"@vueless/storybook-dark-mode": "^10.0.7",
119119
"autoprefixer": "^10.4.27",
120120
"baseline-browser-mapping": "^2.9.19",
@@ -128,7 +128,7 @@
128128
"postcss-utopia": "^1.1.0",
129129
"react-compiler-runtime": "^1.0.0",
130130
"sharp": "^0.34.5",
131-
"storybook": "^10.3.3",
131+
"storybook": "^10.2.19",
132132
"vitest": "4.1.2",
133133
"wrangler": "^4.77.0"
134134
},

0 commit comments

Comments
 (0)