Skip to content

Commit 5c44af4

Browse files
Panthevmclaude
andcommitted
Add GitHub Actions workflow for Storybook deployment
Implements CI/CD pipeline to automatically build and deploy Storybook to GitHub Pages on pushes to master branch. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent afbb489 commit 5c44af4

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: true
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '18'
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 10.14.0
37+
38+
- name: Get pnpm store directory
39+
shell: bash
40+
run: |
41+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
42+
43+
- name: Cache pnpm modules
44+
uses: actions/cache@v4
45+
with:
46+
path: ${{ env.STORE_PATH }}
47+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
48+
restore-keys: |
49+
${{ runner.os }}-pnpm-store-
50+
51+
- name: Install dependencies
52+
run: pnpm install --frozen-lockfile
53+
54+
- name: Build Storybook
55+
run: pnpm --filter @panthevm_original/react-components build-storybook
56+
57+
- name: Setup Pages
58+
if: github.ref == 'refs/heads/master'
59+
uses: actions/configure-pages@v4
60+
61+
- name: Upload artifact
62+
if: github.ref == 'refs/heads/master'
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: packages/react-components/storybook-static
66+
67+
deploy:
68+
if: github.ref == 'refs/heads/master'
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)