@@ -32,21 +32,32 @@ jobs:
3232
3333 - name : Authenticate to Google Cloud
3434 id : auth
35- uses : google-github-actions/auth@v2
35+ uses : google-github-actions/auth@v1
3636 with :
37- create_credentials_file : true
38- token_format : " access_token"
37+ # create_credentials_file: true
38+ token_format : access_token
3939 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
4040 service_account : ${{ secrets.GCP_DEPLOY_SA }}
4141
42+ - name : Set up GCP SDK
43+ uses : google-github-actions/setup-gcloud@v1
44+ with :
45+ version : " latest"
46+ project_id : ${{ secrets.GCP_PROJECT_ID }}
47+
4248 - name : Login to GAR
4349 id : login-gar
4450 uses : docker/login-action@v3
4551 with :
46- registry : ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}
52+ registry : ${{ secrets.GCP_REGION }}-docker.pkg.dev
4753 username : oauth2accesstoken
4854 password : ${{ steps.auth.outputs.access_token }}
4955
56+ - name : Configure Docker for Artifact Registry
57+ run : |
58+ gcloud auth configure-docker \
59+ ${{ secrets.GCP_REGION }}-docker.pkg.dev
60+
5061 - name : Build and Push Docker Image
5162 id : build-and-push
5263 uses : docker/build-push-action@v5
7586 - name : Checkout Repository
7687 uses : actions/checkout@v4
7788
78- - name : Authenticate to Google Cloud
79- id : auth
80- uses : google-github-actions/auth@v2
81- with :
82- create_credentials_file : true
83- workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
84- service_account : ${{ secrets.GCP_DEPLOY_SA }}
85-
8689 - name : Deploy to Cloud Run
8790 id : deploy
8891 uses : google-github-actions/deploy-cloudrun@v2
0 commit comments