Skip to content

chromatic

chromatic #6

Workflow file for this run

name: chromatic
on:
workflow_call:
secrets:
CHROMATIC_PROJECT_TOKEN:
description: 'Token for uploading Storybook to Chromatic'
required: true
workflow_dispatch:
env:
NODE_VERSION: 20
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer
- name: Install dependencies
run: |
npm ci --workspaces --no-audit --ignore-scripts
composer install --prefer-dist
- name: Publish to Chromatic
uses: chromaui/action@latest
with:
buildScriptName: "storybook:build"
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitOnceUploaded: true
exitZeroOnChanges: true