name: storybook

on:
  push:
    branches: [dev]
    paths:
      - ".github/workflows/storybook.yml"
      - "package.json"
      - "bun.lock"
      - "packages/storybook/**"
      - "packages/ui/**"
  pull_request:
    branches: [dev]
    paths:
      - ".github/workflows/storybook.yml"
      - "package.json"
      - "bun.lock"
      - "packages/storybook/**"
      - "packages/ui/**"
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: storybook build
    runs-on: blacksmith-4vcpu-ubuntu-2404
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Bun
        uses: ./.github/actions/setup-bun

      - name: Build Storybook
        run: bun --cwd packages/storybook build
