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 install: true
buildkitd-flags: --debug 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 # Login to GCR
- name: Login to GCR - name: Login to GCR
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: us-docker.pkg.dev registry: us-docker.pkg.dev
username: _json_key username: oauth2accesstoken
password: ${{ secrets.GCR_SA_KEY }} password: ${{ steps.auth.outputs.access_token }}
# Build and push the image, leveraging layer caching # Build and push the image, leveraging layer caching
- name: Build and Push - name: Build and Push