name: storybook

on:
  push:
    branches: [dev]
    paths:
      - ".github/workflows/storybook.yml"
      - "package.json"
      - "bun.lock"
      - "packages/storybook/**"
      - "packages/ui/**"
      - "packages/session-ui/**"
  pull_request:
    branches: [dev]
    paths:
      - ".github/workflows/storybook.yml"
      - "package.json"
      - "bun.lock"
      - "packages/storybook/**"
      - "packages/ui/**"
      - "packages/session-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@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

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

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