get_credentials instead of init for token refresh #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push to Google Artifact Registry GitHub Action | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-push-artifact: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Auth" | |
id: "auth" | |
uses: "google-github-actions/auth@v2" | |
with: | |
credentials_json: "${{ secrets.GCLOUD_SERVICE_KEY }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: "Docker auth" | |
run: |- | |
gcloud auth configure-docker ${{ secrets.REGION }}-docker.pkg.dev --quiet | |
- name: Build image | |
run: docker build . --file Dockerfile --tag ${{ secrets.GAR_LOCATION }} | |
working-directory: image | |
- name: Push image | |
run: docker push ${{ secrets.GAR_LOCATION }} |