Skip to content

Commit

Permalink
fix(storybook): build storybook for chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeb authored Apr 10, 2024
1 parent b756a34 commit dbea64a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1,781 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ on:
branches:
- master

env:
NODE_VERSION: 16.x

jobs:
chromatic:
if: github.repository_owner == 'AxaFrance'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history for Chromatic
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: '*'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run storybook:build
- name: Publish to Chromatic
uses: chromaui/action@v1
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: 2af88e64d1ab
exitOnceUploaded: true
storybookBuildDir: storybook-static
10 changes: 6 additions & 4 deletions .github/workflows/toolkit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ jobs:
if: github.repository_owner == 'AxaFrance'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: '*'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run check
- run: npm test -- --coverage
- run: npm run storybook:build
- name: Publish to Chromatic
uses: chromaui/action@v1
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: 2af88e64d1ab
exitOnceUploaded: true
storybookBuildDir: storybook-static
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ module.exports = {
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-a11y',
'storybook-readme',
],
webpackFinal: async (config) => {
config.module.rules.push({
Expand Down
3 changes: 1 addition & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { addReadme } from 'storybook-readme';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';

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

export const decorators = [addReadme];
export const decorators = [];

export const parameters = {
actions: { argTypesRegex: '^on.*' },
Expand Down
Loading

0 comments on commit dbea64a

Please sign in to comment.