Login to Google Cloud and generate oauth token

This commit is contained in:
Riordan Panayides 2022-08-05 13:49:14 +01:00
parent a7e58ea99d
commit f452b08462
1 changed files with 10 additions and 2 deletions

View File

@ -31,13 +31,21 @@ jobs:
install: true
buildkitd-flags: --debug
# Login to Google Cloud
- name: 'Login to Google Cloud'
uses: 'google-github-actions/auth@v0'
id: auth
with:
token_format: 'access_token'
credentials_json: '${{ secrets.GCR_SA_KEY }}'
# Login to GCR
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_SA_KEY }}
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
# Build and push the image, leveraging layer caching
- name: Build and Push