From d8d505747736f5d3f171129a1b6ea0edc7ca08da Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 3 Jun 2026 16:35:39 -0700 Subject: [PATCH] chore(relay): migrate deployment workflow to vite plus Co-authored-by: codex --- .github/workflows/deploy-relay.yml | 15 ++++++--------- docs/relay-observability.md | 2 +- docs/release.md | 9 ++++----- docs/t3-cloud-clerk.md | 2 +- infra/relay/README.md | 23 +++++++++++------------ 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/.github/workflows/deploy-relay.yml b/.github/workflows/deploy-relay.yml index 7df4d93362..dd27fd2a79 100644 --- a/.github/workflows/deploy-relay.yml +++ b/.github/workflows/deploy-relay.yml @@ -37,21 +37,18 @@ jobs: - name: Checkout uses: actions/checkout@v6 - - name: Setup Bun - uses: oven-sh/setup-bun@v2 - with: - bun-version-file: package.json - - - name: Setup Node - uses: actions/setup-node@v6 + - name: Setup Vite+ + uses: voidzero-dev/setup-vp@v1 with: node-version-file: package.json + cache: true + run-install: false - name: Install dependencies - run: bun install --frozen-lockfile + run: vp install --frozen-lockfile - name: Deploy production relay stage - run: bun --cwd infra/relay run deploy -- --stage prod --yes + run: vp run --filter t3code-relay deploy -- --stage prod --yes env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }} diff --git a/docs/relay-observability.md b/docs/relay-observability.md index 9a096853ad..dafad2155a 100644 --- a/docs/relay-observability.md +++ b/docs/relay-observability.md @@ -12,7 +12,7 @@ Alchemy stages append their sanitized stage name to isolate resources, for examp Deploy from `infra/relay` with the normal Alchemy workflow: ```sh -bun run deploy +vp run deploy ``` Alchemy resolves Axiom deployment credentials through its provider. At runtime, the Worker diff --git a/docs/release.md b/docs/release.md index 082fa08e03..a90c67ee60 100644 --- a/docs/release.md +++ b/docs/release.md @@ -36,10 +36,9 @@ The relay is a shared control plane versioned separately from client releases. S client builds must point at the same relay so users see the same linked environments when switching release channels. -`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. It also -supports manual dispatch for retries. The release workflow reads the relay URL and Clerk -client configuration from the existing `production` GitHub Actions environment before building -desktop, CLI, or hosted web artifacts. +`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. The +release workflow reads the relay URL and Clerk client configuration from the existing `production` +GitHub Actions environment before building desktop, CLI, or hosted web artifacts. Required repository variables shared by relay deployments: @@ -80,7 +79,7 @@ database. Local personal stages provision isolated branches from it and are neve Developers deploy personal stages locally rather than through pull-request automation: ```sh -bun --cwd infra/relay run deploy -- --stage "$USER" --env-file .env.local +vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local ``` ## Hosted web app release deployment diff --git a/docs/t3-cloud-clerk.md b/docs/t3-cloud-clerk.md index 10a05a7ee3..96ade9a213 100644 --- a/docs/t3-cloud-clerk.md +++ b/docs/t3-cloud-clerk.md @@ -37,7 +37,7 @@ When any client-facing public value is absent, cloud UI is omitted. For a hosted relay deployment, copy `infra/relay/.env.example` to `infra/relay/.env`. The relay deployment reads `RELAY_DOMAIN`, `RELAY_ZONE_NAME`, `CLERK_PUBLISHABLE_KEY`, and `CLERK_JWT_AUDIENCE` through Effect `Config`. There are no checked-in deployment defaults. -`bun --cwd infra/relay run deploy` invokes Alchemy from the relay directory, so Alchemy loads +`vp run --filter t3code-relay deploy` invokes Alchemy from the relay directory, so Alchemy loads `infra/relay/.env`. After a successful deployment, the wrapper updates the repository-root `.env` with the HTTPS relay URL derived from `RELAY_DOMAIN`. The relay still requires `CLERK_SECRET_KEY` as an Alchemy secret. Never put `CLERK_SECRET_KEY` in a client application diff --git a/infra/relay/README.md b/infra/relay/README.md index 26d57a275a..823a1ffe52 100644 --- a/infra/relay/README.md +++ b/infra/relay/README.md @@ -52,24 +52,23 @@ calls live in Install dependencies from the repository root, then run relay-focused checks from this directory: ```sh -bun install +vp install cd infra/relay -bun run test -bun run typecheck +vp test run +vp run typecheck ``` To run a smaller test set while iterating: ```sh -bun run test src/environments/EnvironmentLinker.test.ts +vp test run src/environments/EnvironmentLinker.test.ts ``` Before considering a change complete, run the repository-wide checks from the root: ```sh -bun fmt -bun lint -bun typecheck +vp check +vp run typecheck ``` Backend changes should include tests. Prefer testing the real business logic with external @@ -80,7 +79,7 @@ dependencies represented at their boundary rather than mocking internal behavior The relay deploys through Alchemy: ```sh -bun --cwd infra/relay run deploy +vp run --filter t3code-relay deploy ``` The stack provisions the Cloudflare Worker and queues, managed endpoint resources, database @@ -94,8 +93,8 @@ PlanetScale branch and runtime role for local development, so deploy `prod` befo developer stages: ```sh -bun --cwd infra/relay run deploy -- --stage prod -bun --cwd infra/relay run deploy -- --env-file .env.local +vp run --filter t3code-relay deploy -- --stage prod +vp run --filter t3code-relay deploy -- --env-file .env.local ``` Alchemy defaults personal deployments to the `dev_$USER` stage. Relay custom domains apply the same @@ -110,8 +109,8 @@ the URL manually. ### Deployment CI The relay is versioned separately from client releases. `.github/workflows/deploy-relay.yml` deploys -the shared Alchemy `prod` stage on every push to `main`, with a manual dispatch available for -retries. Stable and nightly release builds both resolve their static public config from the same +the shared Alchemy `prod` stage on every push to `main`. Stable and nightly release builds both +resolve their static public config from the same `production` GitHub environment. Pull requests do not deploy relay stages. Developers can deploy personal non-production stages locally with any stage name other than `prod`.