name: Deploy storefronts on: push: branches: [main] workflow_dispatch: # One job per storefront: each builds its own static export and deploys to its # own Cloudflare Worker. Keep this matrix in sync with config/stores.ts. jobs: deploy: name: ${{ matrix.worker }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - { code: executive, worker: rubberquack-executive } - { code: crypto, worker: rubberquack-crypto } - { code: supper, worker: rubberquack-supper } - { code: collector, worker: rubberquack-collector } steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - run: bun install --frozen-lockfile - name: Build ${{ matrix.code }} run: | cp config/store_${{ matrix.code }}.ts config/store.ts bun run build env: NEXT_PUBLIC_STORE_CODE: ${{ matrix.code }} - name: Deploy ${{ matrix.worker }} run: bunx wrangler deploy --name ${{ matrix.worker }} env: NEXT_PUBLIC_STORE_CODE: ${{ matrix.code }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}