Skip to content

Commit

Permalink
chore: chromatic.yml 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
DongjaJ committed Jan 16, 2025
1 parent 589a368 commit 6ef6e71
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Chromatic'

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}

env:
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.ref }}
CHROMATIC_SLUG: ${{ github.repository }}

- name: pnpm-setup-node
uses: ./.github/actions/pnpm-setup-node

- name: Install dependencies
# ⚠️ See your package manager's documentation for the correct command to install dependencies in a CI environment.
run: pnpm install --frozen-lockfile

- name: Run Chromatic
id: chromatic
uses: chromaui/action@latest
with:
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
onlyChanged: true
exitZeroOnChanges: false

- name: comment PR
if: github.event_name == 'pull_request'&& steps.chromatic.outputs.storybookUrl != ''
uses: thollander/actions-comment-pull-request@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: |
🚀 Storybook is ready for review: ${{ steps.chromatic.outputs.storybookUrl }}
Build: ${{ steps.chromatic.outputs.buildUrl }}
comment-tag: chromatic

0 comments on commit 6ef6e71

Please sign in to comment.