Skip to content

Commit e23ef2f

Browse files
committed
Added version tagging to GCP build
1 parent 1c97a14 commit e23ef2f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/gcp_build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ on:
4343
type: string
4444
description: "The platforms to build the image for"
4545
required: false
46+
image-tag:
47+
type: string
48+
description: "Comma-separated list of image tags (e.g., 'latest,v1.2.3')"
49+
required: false
50+
default: "latest"
4651
secrets:
4752
function-admin-api-key:
4853
description: "The API key for the Lambda Feedback function admin API"
@@ -86,4 +91,5 @@ jobs:
8691
8792
IMAGE_URI="europe-west2-docker.pkg.dev/wolfram-evaluation-functions/${{ inputs.environment == 'staging' && 'evaluation-function-staging' || 'evaluation-function' }}/${{inputs.function-name}}:latest"
8893
docker build -t "$IMAGE_URI" .
94+
docker tag "IMAGE_URI" "${{inputs.image-tag}}"
8995
docker push "$IMAGE_URI"

.github/workflows/production_deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ jobs:
254254

255255
build-gcp:
256256
uses: ./.github/workflows/gcp_build.yml
257+
needs: version
257258
if: inputs.build-platforms == 'gcp'
258259
strategy:
259260
fail-fast: false
@@ -267,14 +268,15 @@ jobs:
267268
build-args: ${{ inputs.build-args }}
268269
build-platforms: ${{ inputs.build-platforms }}
269270
build-push: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) }}
271+
image-tag: ${{ needs.version.outputs.version-tag}}
270272
secrets:
271273
function-admin-api-key: ${{ secrets.function-admin-api-key }}
272274
gcp_credentials: ${{ secrets.gcp_credentials }}
273275

274276
deploy-gcp-production:
275277
uses: ./.github/workflows/gcp_deploy.yml
276278
if: inputs.build-platforms == 'gcp' && github.repository != inputs.template-repository-name && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref_name == github.event.repository.default_branch))
277-
needs: build-gcp
279+
needs: [build-gcp, version]
278280
with:
279281
environment: eval-production
280282
api-url: https://prod-api.lambdafeedback.com

0 commit comments

Comments
 (0)