Skip to content

Commit 4d3f238

Browse files
Fix Cloud Run deploy: use --set-build-env-vars instead of --build-arg
The gcloud run deploy command doesn't support --build-arg directly. Use --set-build-env-vars which Cloud Build passes to Docker as build args. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c86f7d7 commit 4d3f238

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
--allow-unauthenticated \
126126
--env-vars-file=env-cloudrun.yaml \
127127
--set-env-vars="GITHUB_APP_ID=${{ secrets.GITHUB_APP_ID }},INSTALLATION_ID=${{ secrets.INSTALLATION_ID }}" \
128-
--build-arg="VERSION=${{ steps.version.outputs.tag }}" \
128+
--set-build-env-vars="VERSION=${{ steps.version.outputs.tag }}" \
129129
--tag="${{ steps.version.outputs.tag }}" \
130130
--max-instances=10 \
131131
--cpu=1 \

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Build stage
22
FROM golang:1.26.0-alpine AS builder
33

4-
# Version is set at build time (e.g. docker build --build-arg VERSION=v1.0.0)
4+
# Version is set at build time via:
5+
# - Docker: docker build --build-arg VERSION=v1.0.0
6+
# - Cloud Run: gcloud run deploy --set-build-env-vars VERSION=v1.0.0
57
ARG VERSION=dev
68

79
# Install build dependencies

0 commit comments

Comments
 (0)