name: build
on:
  workflow_dispatch:
  pull_request:
    types: [opened, reopened, synchronize, ready_for_review]
jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Bun
        uses: oven-sh/setup-bun@v2
        with:
          scope: "@silencelaboratories"
          registry-url: "https://registry.npmjs.org"
          bun-version: "latest"
          
      - name: Install dependencies
        shell: bash
        run: bun install --frozen-lockfile
        env:
          VITE_SILENCE_LABS_NPM_TOKEN: ${{ secrets.VITE_SILENCE_LABS_NPM_TOKEN }}
          BUN_AUTH_TOKEN: ${{ secrets.VITE_SILENCE_LABS_NPM_TOKEN }}
  
      - name: Build
        shell: bash
        run: bun run build
        env:
          VITE_SILENCE_LABS_NPM_TOKEN: ${{ secrets.VITE_SILENCE_LABS_NPM_TOKEN }}
          BUN_AUTH_TOKEN: ${{ secrets.VITE_SILENCE_LABS_NPM_TOKEN }}
