Skip to content

Commit

Permalink
feat: 스토리북 배포 yml 파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
xodms0309 committed Mar 12, 2024
1 parent aed68a0 commit 282641c
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
# Workflow name
name: 'Chromatic Deployment'
name: "Deploy Storybook"

# Event for the workflow
on: pull_request
on:
pull_request:
branches: [feat/v2, develop]
paths:
- '**.stories.tsx'
push:
branches: [feat/v2, develop]
paths:
- '**.stories.tsx'

# List of jobs
jobs:
test:
# Operating System
chromatic:
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v1
- run: yarn
#👇 Adds Chromatic as a step in the workflow
- uses: chromaui/action@v1
# Options required for Chromatic's GitHub Action
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: cache dependencies
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-storybook

- name: depedency install
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@latest
with:
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/ko/deploy/ to obtain it
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: comment PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '🔗 배포된 storybook 주소: ${{ steps.chromatic.outputs.storybookUrl }}'

0 comments on commit 282641c

Please sign in to comment.