Skip to content

Commit a8405b1

Browse files
committed
feat: deploy storybook to github pages
1 parent 836e73b commit a8405b1

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

.github/workflows/chromatic-deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- develop
7+
- project/storybook
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
@@ -12,11 +13,13 @@ concurrency:
1213
permissions:
1314
actions: write
1415
contents: read
16+
pages: write
17+
id-token: write
1518

1619
jobs:
1720
changed-files:
1821
runs-on: ubuntu-latest
19-
name: changed-files
22+
name: Check for changed files
2023
outputs:
2124
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
2225
any_changed: ${{ steps.changed-files.outputs.any_changed }}
@@ -32,7 +35,7 @@ jobs:
3235
packages/ui/**
3336
packages/go-ui-storybook/**
3437
chromatic:
35-
name: Run visual tests
38+
name: Build & Deploy
3639
needs: [changed-files]
3740
if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
3841
uses: ./.github/workflows/chromatic.yml

.github/workflows/chromatic.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ concurrency:
99
permissions:
1010
actions: write
1111
contents: read
12+
pages: write
13+
id-token: write
1214

1315
jobs:
1416
ui:
@@ -66,3 +68,24 @@ jobs:
6668
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
6769
token: ${{ secrets.GITHUB_TOKEN }}
6870
workingDir: packages/go-ui-storybook
71+
github-pages:
72+
name: Deploy to Github Pages
73+
runs-on: ubuntu-latest
74+
needs: [ui]
75+
steps:
76+
- uses: actions/checkout@v4
77+
with:
78+
fetch-depth: 0
79+
- uses: actions/setup-node@v4
80+
with:
81+
node-version: 20
82+
- uses: actions/download-artifact@v4
83+
with:
84+
name: ui-build
85+
path: packages/ui/dist
86+
- uses: bitovi/[email protected]
87+
with:
88+
install_command: yarn install
89+
build_command: yarn build-storybook
90+
path: packages/go-ui-storybook/storybook-static
91+
checkout: false

packages/go-ui-storybook/.storybook/ifrcGoTheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export default create({
44
base: 'light',
55
brandTitle: 'IFRC-GO',
66
brandUrl: '/',
7-
brandImage: '/go-logo.svg',
7+
brandImage: './go-logo.svg',
88
brandTarget: 'IFRC_GO',
99
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<meta name="description" content="IFRC Go UI Library: This repository provides guidance and practical advice for designers, developers, and users adding data, graphics, and dashboards to IFRC Go. It includes the IFRC Go design principles, visual guidelines, UI components. The library is open source and is welcome to be used by anyone across the IFRC network." key="desc" />
2+
3+

packages/go-ui-storybook/src/stories/Introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import pkg from '@togglecorp/fujs/package.json';
77
IFRC Go UI
88
</h1>
99

10-
<img src="/go-logo.svg" alt="IFRC Go logo" className="ifrc-logo" />
10+
<img src="./go-logo.svg" alt="IFRC Go logo" className="ifrc-logo" />
1111

1212
<h3 className="overview">
1313
Overview

0 commit comments

Comments
 (0)