deploy.static.build-and-publish
Build a Vite/SPA on a runner (git clone + build) and stage the built dist/ into a GCS serving bucket, emitting the bucket/prefix/static_url/bundle_ref handoff that deploy.static.publish consumes — the fully-GCP counterpart of cloudflare.pages.build-and-deploy.
Build a Vite/SPA on a runner and stage the built dist/ into a GCS serving bucket.
Overview
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-deployments |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID (context). |
runner_connection_uuid | uuid | Yes | — | Runner group / backend connection UUID the build runs on (GCP-backed so the runner has ambient GCS credentials). |
bucket | string | Yes | — | Destination GCS serving bucket. |
prefix | string | No | — | Destination object prefix under the bucket. |
github_repository_uuid | uuid | No | — | GitHubRepository UUID to build from; resolved to a clone URL + installation token at launch. Provide this OR repo_clone_url. |
repo_clone_url | string | No | — | Explicit HTTPS git clone URL (may embed an x-access-token). Used when github_repository_uuid is not given. |
repo_full_name | string | No | — | owner/name; combined with a GITHUB_TOKEN env var into a clone URL when repo_clone_url is not given. |
source_ref | string | No | — | Branch/tag/ref to build; default main. |
build_command | string | No | — | Build command; default 'npm ci && npm run build'. |
output_dir | string | No | — | Static build output dir uploaded to GCS; default 'dist'. |
node_version | string | No | — | Node.js version; default '20'. |
image_reference | string | No | — | Build image (must contain git, node/npm and the gcloud CLI). Falls back to the runner group default when omitted. |
gcp_connection_uuid | uuid | No | — | GCP CloudConnection UUID for the serving bucket; echoed to deploy.static.publish as connection_uuid. |
project_id | string | No | — | GCP project override. |
env | json | No | — | Plain (non-secret) build env vars. |
secret_env | json | No | — | Secret Manager env mappings (references, not values). |
timeout_seconds | integer | No | — | Build job timeout. |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | Echoed organization UUID. |
runner_execution_uuid | uuid | No | — | Build runner execution UUID. |
status | string | No | — | Build status. |
exit_code | integer | No | — | Build process exit code. |
log_ref | string | No | — | Runner log reference. |
started_at | string | No | — | ISO-8601 start time. |
completed_at | string | No | — | ISO-8601 completion time. |
provider | string | No | — | Storage provider ('gcp'). |
connection_uuid | uuid | No | — | GCP connection UUID for the serving bucket (echoed gcp_connection_uuid). |
project_id | string | No | — | GCP project (carried through). |
bucket | string | No | — | Destination GCS bucket. |
prefix | string | No | — | Destination object prefix. |
static_url | string | No | — | Public GCS URL of the built site entrypoint. |
bundle_ref | string | No | — | gs:// URI of the staged assets root. |
manifest_ref | string | No | — | gs:// URI of the enumerated manifest.json the runner wrote (files/content-type/size). |
manifest | list | No | — | Enumerated static-file manifest for deploy.static.publish. Hydrated from manifest_ref by the consumer; not populated in-workflow (no GCS read-back primitive exists yet). |
uploaded_count | integer | No | — | Objects uploaded to GCS. Best-effort; may be null until a GCS read-back primitive lets the workflow read the runner-written manifest. |
failure_reason | string | No | — | Failure reason. |
failed_step | json | No | — | Failed step envelope. |
failed_layer | json | No | — | Failed layer envelope. |
failed_at_state | string | No | — | State where failure occurred. |
error | string | No | — | Error message. |
error_type | string | No | — | Error class. |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | launch | — |
waiting | No | No | — | — | Polling the build runner execution |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | launch | waiting | — |
waiting | poll | waiting | — |
waiting | complete | completed | — |
* (any state) | fail | failed | — |
API Usage
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "deploy.static.build-and-publish",
"initial_data": {
"organization_uuid": "value",
"runner_connection_uuid": "value",
"bucket": "value"
}
}