chore(relay): migrate deployment workflow to vite plus
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
4952f36289
commit
d8d5057477
5 files changed
+23
-28
No files matched your search
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
|
||||
+4
-5
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+11
-12
@@ -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`.
|
||||
|
||||
|
||||
Reference in new issue
Block a user