-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.85 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
---
name: Chromatic
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
commit:
name: Publish to Chromatic
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Wait for Vercel
if: github.run_attempt == '1' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
run: sleep 20
- name: Get Vercel preview
uses: ViktorJT/[email protected]
if: github.ref_name != 'main' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
id: vercel
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
vercel_access_token: ${{ secrets.VERCEL_ACCESS_TOKEN }}
vercel_team_id: ${{ vars.VERCEL_TEAM_ID }}
prefix_url: 'https://'
prefix_path: /api
- name: Get Seam endpoint
id: seam_endpoint
env:
STORYBOOK_SEAM_ENDPOINT: ${{ vars.STORYBOOK_SEAM_ENDPOINT }}
VERCEL_PREVIEW_URL: ${{ steps.vercel.outputs.preview_url }}
run: |
if [ -n "$VERCEL_PREVIEW_URL" ]; then
echo "url=${VERCEL_PREVIEW_URL}" >> $GITHUB_OUTPUT
else
echo "url=${STORYBOOK_SEAM_ENDPOINT}" >> $GITHUB_OUTPUT
fi
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: de095a2cb27a
buildScriptName: storybook:build
env:
STORYBOOK_SEAM_ENDPOINT: ${{ steps.seam_endpoint.outputs.url }}
STORYBOOK_SEAM_PUBLISHABLE_KEY: ${{ vars.STORYBOOK_SEAM_PUBLISHABLE_KEY }}
STORYBOOK_SEAM_USER_IDENTIFIER_KEY: ${{ vars.STORYBOOK_SEAM_USER_IDENTIFIER_KEY }}