feat: bootstrap multi-tenant storefront showcase
This commit is contained in:
41
.gitea/workflows/deploy.yml
Normal file
41
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
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 }}
|
||||
Reference in New Issue
Block a user