Build and push to Artifact Registry in parallel with gcr.io so we can verify the workflow

Google Container Registry is getting deprecated in favor of Artifact Registry so we need to migrate the contains over.

This CL builds and pushes to Artifact Registry whenever something is pushed and built to the Container Registry. This will be used to verify that the Artifact Registry works.
This commit is contained in:
Quoc Truong 2024-08-06 14:19:30 -07:00 committed by GitHub
parent 578302f419
commit 740e70cbd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,15 @@ jobs:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCP_CREDS }}
-
name: Login to AR
# Once this is verified, change the label's name. For now, we will piggyback on gcr.io actions.
if: contains(github.event.pull_request.labels.*.name, 'build and push to gcr.io for staging')
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: us-central1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCP_CREDS }}
-
name: Grab the date to do cache busting (assumes same day OK to keep)
run: |
@ -74,6 +83,7 @@ jobs:
CACHEBUSTER=${{ steps.date.outputs.DATE }}
tags: |
gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-from: |
type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }}
type=registry,ref=gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}