Skip to content

Commit 656a6de

Browse files
authored
Create deploy-storybook-github-pages
1 parent 72d1f52 commit 656a6de

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: 'pages'
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
26+
env:
27+
NODE_OPTIONS: --max_old_space_size=4096
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '18'
37+
cache: 'yarn'
38+
39+
- name: Install dependencies
40+
run: yarn install --immutable
41+
42+
- name: Install Playwright browsers
43+
run: |
44+
npx playwright install
45+
46+
- name: Build Storybook
47+
run: |
48+
cd apps/storybook
49+
turbo run build
50+
ls -la storybook-static/
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: ./apps/storybook/storybook-static
56+
57+
deploy:
58+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
59+
runs-on: ubuntu-latest
60+
needs: build
61+
steps:
62+
- name: Setup Pages
63+
uses: actions/configure-pages@v4
64+
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)