Skip to content

Commit

Permalink
ci: setup chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
pczeglik-iohk committed Jul 1, 2024
1 parent 5ee8bdb commit 14c04f8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/actions/chromatic/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: deploy chromatic
description: Deploy storybook to Chromatic

inputs:
TOKEN:
description: 'Chromatic token'
required: true

runs:
using: 'composite'

steps:
- name: Tests
run: yarn test-storybook:ci
shell: bash

- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
uses: chromaui/action@v1
with:
projectToken: ${{ inputs.TOKEN }}
buildScriptName: build-storybook
onlyChanged: true
exitOnceUploaded: true

- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/main'
uses: chromaui/action@v1
with:
projectToken: ${{ inputs.TOKEN }}
autoAcceptChanges: true
onlyChanged: true
exitOnceUploaded: true
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ jobs:

- name: Typecheck
run: yarn type-check

- name: Chromatic
uses: ./.github/actions/chromatic
with:
TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release

- name: Chromatic
uses: ./.github/actions/chromatic
with:
TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

0 comments on commit 14c04f8

Please sign in to comment.