Skip to content

Merge pull request #41 from depromeet/chore/tab #11

Merge pull request #41 from depromeet/chore/tab

Merge pull request #41 from depromeet/chore/tab #11

name: 'Deploy Storybook with Chromatic'
on:
pull_request:
branches: [main]
paths:
- '**.stories.tsx'
push:
branches: [main]
paths:
- '**.stories.tsx'
jobs:
deployment:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-storybook
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install
- name: Publish to chromatic
id: chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: build-storybook
onlyChanged: true
- name: comment PR
uses: thollander/actions-comment-pull-request@v1
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
message: '๐Ÿš€storybook: ${{ steps.chromatic.outputs.storybookUrl }}'