forked from KaotoIO/kaoto
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.78 KB
/
chromatic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# .github/workflows/chromatic.yml
# Workflow name
name: 📖 Storybook (via Chromatic)
# Event for the workflow
on:
# 👇 Triggers the workflow on push events to the main branch
push:
branches:
- main
# 👇 Triggers the workflow on pull request events to the main branch
pull_request:
branches:
- main
# List of jobs
jobs:
chromatic-deployment:
if: github.repository == 'KaotoIO/kaoto-next' && github.actor != 'renovate[bot]'
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v4
with:
# 👇 Fetches all Git history so that Chromatic can compare against the previous version
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@kaoto-next'
cache: 'yarn'
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
- name: Install dependencies
run: yarn
# 👇 Builds the kaoto-next/ui in library mode
- name: Build ui library
run: yarn workspace @kaoto-next/ui run build:lib
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v10
# Chromatic GitHub Action options
with:
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/en/deploy/ to obtain it
projectToken: chpt_7a4940aa65b14ab
token: ${{ secrets.GITHUB_TOKEN }}
buildScriptName: build:storybook
workingDir: packages/ui-tests