Skip to content

Commit 8fed5be

Browse files
feat: always deploy to GCP, overwrite on branch pushes
- Branch pushes to cohere use a stable image name (cohere-latest) and overwrite the existing GCP image each time - Tag pushes (podvm-v*) create a new GCP image per tag version - workflow_dispatch respects the replace_existing_image input Ref: CC-192
1 parent 8949b4b commit 8fed5be

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/build-podvm-cohere.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
outputs:
7272
image_name: ${{ steps.meta.outputs.image_name }}
7373
image_tag: ${{ steps.meta.outputs.image_tag }}
74+
replace_image: ${{ steps.meta.outputs.replace_image }}
7475
oci_ref: ${{ steps.push.outputs.oci_ref }}
7576
oci_digest: ${{ steps.push.outputs.digest }}
7677
steps:
@@ -132,8 +133,10 @@ jobs:
132133
run: |
133134
if [[ "$GITHUB_REF" == refs/tags/podvm-v* ]]; then
134135
TAG="${GITHUB_REF#refs/tags/podvm-}"
136+
REPLACE_IMAGE="false"
135137
else
136-
TAG="dev-$(date +%Y%m%d)-${GITHUB_SHA::8}"
138+
TAG="cohere-latest"
139+
REPLACE_IMAGE="true"
137140
fi
138141
TAG="${TAG//./-}"
139142
IMAGE_NAME="podvm-${DISTRO}-${TEE_PLATFORM}-${PROFILE}-${TAG}"
@@ -146,6 +149,7 @@ jobs:
146149
echo "caa_commit=$GITHUB_SHA"
147150
echo "caa_commit_short=${GITHUB_SHA::7}"
148151
echo "caa_ref=${GITHUB_REF_NAME}"
152+
echo "replace_image=$REPLACE_IMAGE"
149153
} >> "$GITHUB_OUTPUT"
150154
echo "Building: $IMAGE_NAME (tag: $TAG)"
151155
@@ -325,12 +329,12 @@ jobs:
325329
needs: build
326330
if: |
327331
always() && needs.build.result == 'success' &&
328-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/podvm-v') ||
332+
(github.event_name == 'push' ||
329333
github.event_name == 'workflow_dispatch' && inputs.deploy_gcp)
330334
uses: ./.github/workflows/deploy-gcp-cohere.yaml
331335
with:
332336
image_tag: ${{ needs.build.outputs.image_tag }}
333-
replace_existing_image: ${{ inputs.replace_existing_image || false }}
337+
replace_existing_image: ${{ needs.build.outputs.replace_image == 'true' || inputs.replace_existing_image || false }}
334338
secrets:
335339
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
336340
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}

0 commit comments

Comments
 (0)