Skip to content

add ci/cd

add ci/cd #13

Workflow file for this run

name: Build and Deploy Storybook
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
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: Run linting
run: npm run lint
- name: Build Storybook
run: npm run build-storybook
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v4
with:
enablement: true
- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: ./storybook-static
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4