Skip to content

Commit 8c3ecfe

Browse files
chore: adding github workflow to build storybook react merge to main branch
1 parent 00e81a1 commit 8c3ecfe

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build Storybook Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_call:
8+
secrets:
9+
PUBLISH_STORYBOOK_TOKEN:
10+
required: true
11+
12+
jobs:
13+
build-deploy-storybook:
14+
name: Build and Deploy Storybook
15+
permissions:
16+
contents: write
17+
runs-on: ubuntu-latest
18+
environment: github-pages
19+
defaults:
20+
run:
21+
working-directory: apps/storybook-react
22+
steps:
23+
- name: Checkout and setup environment
24+
uses: MetaMask/action-checkout-and-setup@v1
25+
with:
26+
is-high-risk-environment: false
27+
cache-node-modules: true
28+
29+
- name: Build required packages
30+
working-directory: .
31+
run: |
32+
yarn workspace @metamask/design-tokens build
33+
yarn workspace @metamask/design-system-tailwind-preset build
34+
yarn workspace @metamask/design-system-react build
35+
36+
- name: Build Storybook
37+
run: yarn build-storybook
38+
39+
- name: Deploy to GitHub Pages
40+
uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935
41+
with:
42+
personal_token: ${{ secrets.PUBLISH_STORYBOOK_TOKEN }}
43+
publish_dir: apps/storybook-react/storybook-static
44+
destination_dir: .
45+
force_orphan: true

0 commit comments

Comments
 (0)