Skip to content

Commit 6ec975f

Browse files
Added Storybook deployment workflow
1 parent 436dc4b commit 6ec975f

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy Storybook
2+
3+
on:
4+
push:
5+
branches: [mm-storybook-deployment]
6+
paths:
7+
- 'src/**'
8+
- '.storybook/**'
9+
- 'package.json'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: 'pages'
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
ref: ${{ github.ref }}
29+
clean: true
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 22
35+
36+
- name: Setup pnpm
37+
run: npm install -g pnpm
38+
39+
- name: Install Dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Build Stencil components
43+
run: pnpm run build
44+
45+
- name: Build Storybook
46+
run: pnpm run storybook-build
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v4
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: ./storybook-static
55+
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

.storybook/public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdk-dapp-ui.multiversx.com

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@
8484
"build:dev": "stencil build --dev",
8585
"build": "stencil build --prod && tsc -p tsconfig.utils.json && tsc-alias -p tsconfig.utils.json",
8686
"start": "yarn run build:dev --watch --serve",
87-
"storybook-tailwind": "npx ts-node .storybook/generate-safelist.ts && npx @tailwindcss/cli -i src/global/tailwind.css -o .storybook/tailwind.css --content '.storybook/tailwind-safelist.html' && rm -f .storybook/tailwind-safelist.html",
88-
"storybook": "yarn run storybook-tailwind && storybook dev -p 6006 --no-open"
87+
"storybook-build-tailwind": "npx ts-node .storybook/generate-safelist.ts && npx @tailwindcss/cli -i src/global/tailwind.css -o .storybook/tailwind.css --content '.storybook/tailwind-safelist.html' && rm -f .storybook/tailwind-safelist.html",
88+
"storybook-dev": "yarn run build && yarn run storybook-build-tailwind && storybook dev -p 6006 --no-open",
89+
"storybook-build": "yarn run build && yarn run storybook-build-tailwind && storybook build"
8990
},
9091
"dependencies": {
9192
"@stencil/core": "^4.36.2",

0 commit comments

Comments
 (0)