-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.49 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
# Workflow name
name: 'Chromatic Deployment'
# Event for the workflow
on: push
# List of jobs
jobs:
test:
name: 'Chromatic Deployment'
runs-on: ubuntu-latest
steps:
- name: 'Check out Git repository'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Check secrets'
id: check-secrets
run: echo "has-secrets=$([ -n "${{ env.CHROMATIC_PROJECT_TOKEN }}" ] && echo true || echo false)" >> $GITHUB_OUTPUT
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Setup Node
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: yarn
- name: 'Warn required secrets'
if: ${{ steps.check-secrets.outputs.has-secrets == 'false' }}
run: echo 'CHROMATIC_PROJECT_TOKEN missing in Github secrets. Skipping Storybook deployment.'
- name: 'Install dependencies'
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
run: yarn
- uses: chromaui/action@v1
if: ${{ steps.check-secrets.outputs.has-secrets == 'true' }}
with:
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/en/deploy/ to obtain it
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
STORYBOOK_BACKEND_URL: ${{ secrets.BACKEND_URL }}