From 860e4e2c1a9ab605493d2a54b0e5304a7a211a97 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 1 Mar 2022 15:16:52 +0800 Subject: [PATCH] Remove gcp auth action. Use JSON key as docker login secret instead. Signed-off-by: Xun Jiang --- .github/workflows/push.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index aa8fa9b0b..bac9c2782 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -47,23 +47,12 @@ jobs: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} ./hack/docker-push.sh - # actions/checkout MUST come before auth - - uses: 'actions/checkout@v2' - - # auth to GCP with OIDC token from GCP Workload Identity Provider. Output auth result to access token. - - id: 'auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v0.6.0' - with: - credentials_json: '${{ secrets.GCR_SA_KEY }}' - token_format: 'access_token' - - # Use access_token generated above to login gcr.io + # 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: 'oauth2accesstoken' - password: '${{ steps.auth.outputs.access_token }}' + 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