-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (59 loc) · 2.02 KB
/
icons-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
60
61
62
63
64
65
66
67
68
69
# .github/workflows/chromatic.yml
# Workflow name
name: "Chromatic Deployment - Icons"
# Event for the workflow
on:
push:
branches:
- "main"
paths:
- ".github/workflows/icons-chromatic.yml"
- "packages/design-system-icons/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/icons-chromatic.yml"
- "packages/design-system-icons/**"
# List of jobs
jobs:
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to retrieve git history
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- uses: nrwl/nx-set-shas@v3
- name: Nx Cache
uses: actions/cache@v3
with:
path: node_modules/.cache/nx
key: ${{ github.repository }}-nx-${{ env.NX_BASE }}
restore-keys: |
${{ github.repository }}-nx-
- name: Install dependencies
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g., yarn, npm, pnpm
run: npm ci
- name: Build design-system-icons package
run: npm run build:design-system-icons
# 👇 Adds Chromatic as a step in the workflow
- id: chromatic
name: Publish design-system-icons to Chromatic
uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN_ICONS }}
buildScriptName: build-storybook:design-system-icons
- name: Comment preview link
if: ${{ github.event_name == 'pull_request' }}
uses: NejcZdovc/comment-pr@v2.0.0
with:
message: "Icons Storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
identifier: "ICONS_PREVIEW_LINK_COMMENT"
github_token: ${{ secrets.GITHUB_TOKEN }}