Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/platform-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ name: Deploy Platform Staging

on:
workflow_dispatch:
push:
branches: [main]
# Same filter as platform-ci.yml: workers bundle the SDK, so SDK-only
# changes must redeploy staging too.
paths:
- 'platform/**'
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'vite.config.ts'
- '.github/workflows/platform-*.yml'

concurrency:
# One running deploy plus at most one pending. Never interrupt a deploy
# between the api migration and the workers that depend on it.
group: platform-deploy-staging
cancel-in-progress: false

permissions: {}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/platform-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Platform Smoke Test

on:
schedule:
- cron: '0 0 * * *' # daily at 8am SGT (midnight UTC)
workflow_dispatch:

permissions: {}
Expand Down
2 changes: 1 addition & 1 deletion platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Paths in this file are relative to `platform/` unless they begin with `../`. For

The `@voidcloud/platform` workspace package retains the dashboard-only `dev` and `build` scripts. Dashboard deploys run after the platform workers in the platform deploy pipeline.

**Manual deploys only. Do not ask to push or deploy.**
**Production deploys are manual only; staging deploys on every push to `main`.** See [`meta/operations.md`](./meta/operations.md#github-actions) for the workflow triggers. Do not ask to push or deploy.

## Local Development

Expand Down
16 changes: 9 additions & 7 deletions platform/meta/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Five Cloudflare Workers:

Two fully isolated environments. Each has its own CF resources (KV, R2, dispatch namespace, analytics engine) and a separate Hyperdrive configuration pointing to its own PlanetScale PostgreSQL database.

| Environment | API URL | Dashboard | User Sites | Trigger |
| -------------- | ------------------------ | ------------------------- | -------------------- | --------------------------------------------- |
| **Production** | `api.void.cloud` | `dash.void.cloud` | `*.void.app` | Manual: "Deploy Platform Production" workflow |
| **Staging** | `api.staging.void.cloud` | `dash.staging.void.cloud` | `*.staging.void.app` | Manual: "Deploy Platform Staging" workflow |
| Environment | API URL | Dashboard | User Sites | Trigger |
| -------------- | ------------------------ | ------------------------- | -------------------- | ----------------------------------------------------------------------------- |
| **Production** | `api.void.cloud` | `dash.void.cloud` | `*.void.app` | Manual: "Deploy Platform Production" workflow |
| **Staging** | `api.staging.void.cloud` | `dash.staging.void.cloud` | `*.staging.void.app` | Automatic: "Deploy Platform Staging" on push to `main` (also manual dispatch) |
Comment thread
Brooooooklyn marked this conversation as resolved.
Resolved

## Cloudflare Resources

Expand Down Expand Up @@ -231,7 +231,7 @@ Two GitHub environments (`Prod` and `Staging`) share the same repo-level secrets
| `CF_ACCESS_CLIENT_ID_STAGING` | Staging | CF Access service-token client id for reaching staging (see Staging Access Control) |
| `CF_ACCESS_CLIENT_SECRET_STAGING` | Staging | CF Access service-token client secret for reaching staging |

`platform-deploy.yml` uses the `Prod` environment; `platform-deploy-staging.yml` uses `Staging`. Both run only on manual dispatch and only when the repository variable `VOID_PLATFORM_DEPLOY_ENABLED` is `true`.
`platform-deploy.yml` uses the `Prod` environment and runs only on manual dispatch; `platform-deploy-staging.yml` uses `Staging` and also runs on every push to `main` that matches the `platform-ci.yml` path filter. Both run only when the repository variable `VOID_PLATFORM_DEPLOY_ENABLED` is `true`.

**GitHub Actions `CF_API_TOKEN` permissions** — narrower-scope token used only for wrangler deploys. Separate from the API worker runtime token.

Expand Down Expand Up @@ -520,13 +520,15 @@ Four platform workflows live in the repository-level `.github/workflows/` direct
2. `vp run build` (SDK packages the dashboard bundles)
3. `vp run --filter @voidcloud/platform deploy` (api with drizzle-kit migrations, proxy, tail, dispatch, dashboard)

**`platform-deploy-staging.yml`** — manual dispatch (staging, environment: `Staging`):
**`platform-deploy-staging.yml`** — push to `main` that matches the `platform-ci.yml` path filter, or manual dispatch (staging, environment: `Staging`):

1. Runs `platform-ci.yml` first
2. `vp run build`
3. `vp run --filter @voidcloud/platform deploy:staging` (same order, all to staging)

**`platform-smoke-test.yml`** — manual dispatch (environment: `Staging`): builds the SDK, deploys `playground/kitchen-sink` to staging with `void deploy`, resets its state, and runs `platform/scripts/kitchen-sink-smoke-test.ts` against `https://kitchen-sink.staging.void.app`.
A `concurrency` group (`platform-deploy-staging`, `cancel-in-progress: false`) keeps one deploy running and at most one pending, so a burst of pushes never interrupts a deploy between the API migration and the workers.

**`platform-smoke-test.yml`** — manual dispatch and a daily cron (`0 0 * * *`, 8am SGT), environment: `Staging`: builds the SDK, deploys `playground/kitchen-sink` to staging with `void deploy`, resets its state, and runs `platform/scripts/kitchen-sink-smoke-test.ts` against `https://kitchen-sink.staging.void.app`.

### Health Checks

Expand Down