Skip to content

Commit

Permalink
feat: Add storybookw workflow for main and develop branches
Browse files Browse the repository at this point in the history
- Configure GitHub Actions to deploy Storybook on pushes to main and develop branches
- Deploy to different directories for main (storybook) and develop (storybook-develop)
  • Loading branch information
choiseona committed Nov 11, 2024
1 parent a69eaba commit 0c423a8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/storybook-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Storybook Production

on:
push:
branches:
- main
- develop
paths:
- client/**

defaults:
run:
working-directory: ./client

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
cache-dependency-path: "./client/pnpm-lock.yaml"

- name: Install dependencies
run: pnpm install

- name: Build storybook
run: pnpm run build-storybook

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/storybook-static
destination_dir: ${{ github.ref == 'refs/heads/main' && 'storybook' || 'storybook-develop' }}

0 comments on commit 0c423a8

Please sign in to comment.