Skip to content

Setting build storybook GitHub actions #6

Setting build storybook GitHub actions

Setting build storybook GitHub actions #6

Workflow file for this run

name: Storybook CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
storybook-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-storybook
- name: Install dependencies
run: npm install
- name: Build Storybook
run: npm run build-storybook
- name: Publish to Chromatic
id: chromatic
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
run: npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: 'storybook 확인좀용: ${{ steps.chromatic.outputs.storybookUrl }}'