when:
  - event: push
    branch: sv-fe
    paths:
      - bobbin/**
      - lexicons/**
      - Cargo.toml
      - Cargo.lock
      - rust-toolchain.toml
      - .tangled/workflows/deploy-bobbin-dev.yml

engine: microvm
image: nixos

virtualisation:
  docker: true

dependencies:
  - nodejs
  - pnpm

steps:
  - name: install bobbin worker dependencies
    command: |
      cd bobbin/worker
      pnpm install --frozen-lockfile

  - name: typecheck bobbin worker
    command: |
      cd bobbin/worker
      pnpm run typecheck

  - name: deploy bobbin dev worker
    command: |
      cd bobbin/worker
      CLOUDFLARE_API_TOKEN=$CLOUDFLARE_WORKER_DEPLOY_TOKEN pnpm exec wrangler deploy --config wrangler.dev.jsonc
