diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b71227680..20da9f459 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -55,3 +55,16 @@ jobs: run: | docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} ./hack/docker-push.sh + + # Use the JSON key in secret to login gcr.io + - uses: 'docker/login-action@v1' + with: + registry: 'gcr.io' # or REGION.docker.pkg.dev + username: '_json_key' + password: '${{ secrets.GCR_SA_KEY }}' + + # Push image to GCR to facilitate some environments that have rate limitation to docker hub, e.g. vSphere. + - name: Publish container image to GCR + if: github.repository == 'vmware-tanzu/velero' + run: | + REGISTRY=gcr.io/velero-gcp ./hack/docker-push.sh diff --git a/changelogs/unreleased/4623-jxun b/changelogs/unreleased/4623-jxun new file mode 100644 index 000000000..56e0fe4e3 --- /dev/null +++ b/changelogs/unreleased/4623-jxun @@ -0,0 +1 @@ +Add pushing image to GCR in github workflow to facilitate some environments that have rate limitation to docker hub, e.g. vSphere.