Skip to content

정기 클래스 관련 추가 구현 및 리팩토링 #10

정기 클래스 관련 추가 구현 및 리팩토링

정기 클래스 관련 추가 구현 및 리팩토링 #10

name: Storybook CI/CD Pipeline
on:
push:
paths:
- '.storybook/**'
- 'src/components/**'
pull_request:
paths:
- '.storybook/**'
- 'src/components/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Build Storybook
run: npm run build-storybook
- name: Upload Storybook build
uses: actions/upload-artifact@v4
with:
name: storybook
path: ./storybook-static
deploy:
if: github.ref == 'refs/heads/dev'
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Storybook build
uses: actions/download-artifact@v4
with:
name: storybook
path: ./storybook-build/storybook
- name: Deploy Storybook to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ./storybook-build
token: ${{ secrets.GH_TOKEN }}
clean: true