-
Notifications
You must be signed in to change notification settings - Fork 18
50 lines (44 loc) · 1.37 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
# based on .github/workflows/chromatic.yml
# Workflow name
name: 'Chromatic'
# Event for the workflow
on:
pull_request:
types: [opened,edited,reopened,synchronize,labeled]
paths:
- '_dev/**'
push:
branches:
- master
env:
NODE_VERSION: 20
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
if: github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'waiting for UX') && github.event.pull_request.head.repo.full_name == 'PrestaShopCorp/ps_facebook')
# Job steps
steps:
# 👇 Version 2 of the action
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: '_dev/package-lock.json'
- name: Install dependencies
working-directory: ./_dev
run: npm install
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v10
# Chromatic GitHub Action options
with:
workingDir: ./_dev
token: ${{ secrets.GITHUB_TOKEN }}
# 👇 Chromatic projectToken
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}