Skip to content

feat: CI deploy storybook #1

feat: CI deploy storybook

feat: CI deploy storybook #1

name: Deploy Storybook to GH Pages
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: deploy-storybook
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build Storybook
run: npm run build-storybook
- name: Deploy to GitHub Pages (gh-pages branch)
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: storybook-static
# Keep history disabled for smaller gh-pages branch
keep_files: false