Skip to content

feat: chromatic deployment #4

feat: chromatic deployment

feat: chromatic deployment #4

Workflow file for this run

name: "Chromatic Deployment"
on:
pull_request:
types: [opened, synchronize]
branches: [main]
paths:
- "**/*.mdx"
- "**/*.tsx"
- "**/*.ts"
jobs:
chromatic:
name: "Run Chromatic"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile # Install dependencies with lockfile's versions to ensure consistency
- name: Cache Build
id: cache-build
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-build-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx') }} # Cache key based on OS and file hashes
restore-keys: |
${{ runner.os }}-build-
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: pnpm build
- uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
diagnostic: true
exitZeroOnChanges: true