Skip to main content
Version: v4 (current)

GCP Cloud Run (Experimental)

Run Unity builds as Cloud Run Jobs - one-off serverless container executions with configurable storage backends.

Experimental

This provider is experimental. APIs and behavior may change between releases.

Prerequisites

  • Google Cloud SDK installed and authenticated (gcloud auth login or GOOGLE_APPLICATION_CREDENTIALS)
  • Cloud Run Jobs API enabled: gcloud services enable run.googleapis.com
  • Service account with roles: Cloud Run Admin, Storage Admin, Logs Viewer

Storage Types

Set gcpStorageType to control how the build accesses large files. Each type has different trade-offs for performance, persistence, and complexity.

TypeHow it worksBest forSize limit
gcs-fuseMounts a GCS bucket as a POSIX filesystem via FUSELarge sequential I/O, artifactsUnlimited
gcs-copyCopies artifacts in/out via gsutilSimple upload/downloadUnlimited
nfsMounts a Filestore instance as NFS shareUnity Library (small random reads)100 TiB
in-memorytmpfs volume inside the containerScratch/temp during builds32 GiB

When to use each type

  • gcs-fuse (default) - Good general-purpose option. Handles very large files well and persists across builds. Has some latency on small file I/O and eventual consistency edge cases.

  • gcs-copy - Simpler than FUSE (no driver). Copies everything before the build starts and uploads after it finishes. Best when you only need artifact upload/download, not live filesystem access during the build.

  • nfs - True POSIX semantics with good random I/O performance. The best choice for caching the Unity Library folder (thousands of small files). Requires a Filestore instance and a VPC connector.

  • in-memory - Fastest option (RAM-backed). Data is lost when the job ends. Capped at 32 GiB. Use for temporary build artifacts that don't need to persist.

Inputs

InputDefaultDescription
gcpProject$GOOGLE_CLOUD_PROJECTGCP project ID
gcpRegionus-central1Cloud Run region
gcpStorageTypegcs-fuseStorage backend (see above)
gcpBucket-GCS bucket name (for gcs-fuse, gcs-copy)
gcpFilestoreIp-Filestore IP address (for nfs)
gcpFilestoreShare/share1Filestore share name (for nfs)
gcpMachineTypee2-standard-4Machine type
gcpDiskSizeGb100In-memory volume size (for in-memory, max 32)
gcpServiceAccount-Service account email
gcpVpcConnector-VPC connector (required for nfs)

Examples

GCS FUSE - mount bucket as filesystem

- uses: game-ci/unity-builder@v4
with:
providerStrategy: gcp-cloud-run
gcpProject: my-project
gcpBucket: my-unity-builds
targetPlatform: StandaloneLinux64

NFS - Filestore for fast Library caching

- uses: game-ci/unity-builder@v4
with:
providerStrategy: gcp-cloud-run
gcpProject: my-project
gcpStorageType: nfs
gcpFilestoreIp: 10.0.0.2
gcpFilestoreShare: /share1
gcpVpcConnector: my-connector
targetPlatform: StandaloneLinux64

Copy - simple artifact upload/download

- uses: game-ci/unity-builder@v4
with:
providerStrategy: gcp-cloud-run
gcpProject: my-project
gcpStorageType: gcs-copy
gcpBucket: my-unity-builds
targetPlatform: StandaloneLinux64