Skip to content

Commit dbea64a

Browse files
authored
fix(storybook): build storybook for chromatic
1 parent b756a34 commit dbea64a

File tree

6 files changed

+47
-1781
lines changed

6 files changed

+47
-1781
lines changed

.github/workflows/chromatic.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ on:
55
branches:
66
- master
77

8-
env:
9-
NODE_VERSION: 16.x
10-
118
jobs:
129
chromatic:
1310
if: github.repository_owner == 'AxaFrance'
1411
runs-on: ubuntu-latest
1512
steps:
16-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1714
with:
1815
fetch-depth: 0 # 👈 Required to retrieve git history for Chromatic
1916
- name: Use Node.js
20-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
2118
with:
22-
node-version: ${{ env.NODE_VERSION }}
19+
node-version: '*'
2320
registry-url: 'https://registry.npmjs.org'
2421
cache: 'npm'
2522
- run: npm ci
2623
- run: npm run build
24+
- run: npm run storybook:build
2725
- name: Publish to Chromatic
28-
uses: chromaui/action@v1
26+
uses: chromaui/action@latest
2927
with:
3028
token: ${{ secrets.GITHUB_TOKEN }}
3129
projectToken: 2af88e64d1ab
3230
exitOnceUploaded: true
31+
storybookBuildDir: storybook-static

.github/workflows/toolkit-ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@ jobs:
1010
if: github.repository_owner == 'AxaFrance'
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0 # 👈 Required to retrieve git history
1616
- name: Use Node.js
17-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
1818
with:
19-
node-version: 16.x
19+
node-version: '*'
2020
cache: 'npm'
2121
- run: npm ci
2222
- run: npm run build
2323
- run: npm run check
2424
- run: npm test -- --coverage
25+
- run: npm run storybook:build
2526
- name: Publish to Chromatic
26-
uses: chromaui/action@v1
27+
uses: chromaui/action@latest
2728
with:
2829
token: ${{ secrets.GITHUB_TOKEN }}
2930
projectToken: 2af88e64d1ab
3031
exitOnceUploaded: true
32+
storybookBuildDir: storybook-static

.storybook/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ module.exports = {
4848
'@storybook/addon-essentials',
4949
'@storybook/addon-storysource',
5050
'@storybook/addon-a11y',
51-
'storybook-readme',
5251
],
5352
webpackFinal: async (config) => {
5453
config.module.rules.push({

.storybook/preview.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { addReadme } from 'storybook-readme';
21
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
32

43
import '../packages/all/dist/style/af-toolkit-core.css';
54
import '../packages/core/dist/assets/fonts/icons/af-icons.css';
65
import './storybook.css';
76

8-
export const decorators = [addReadme];
7+
export const decorators = [];
98

109
export const parameters = {
1110
actions: { argTypesRegex: '^on.*' },

0 commit comments

Comments
 (0)