From f819885a3632f33db7f86489ebfa50036931e164 Mon Sep 17 00:00:00 2001 From: Luke <130188542+lukehaz@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:47:33 -0800 Subject: [PATCH] try alternate way of logging in to GC --- .github/workflows/apprentice-action-test.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apprentice-action-test.yml b/.github/workflows/apprentice-action-test.yml index 961992e..456a1d6 100644 --- a/.github/workflows/apprentice-action-test.yml +++ b/.github/workflows/apprentice-action-test.yml @@ -33,9 +33,12 @@ jobs: - name: push Docker image to Docker Hub run: docker push ${{ secrets.DOCKER_USER_NAME }}/test-image - - name: Log in to Google Cloud - run: gcloud auth login ${{ secrets.GCLOUD_EMAIL }} --password-stdin <<<"${{ secrets.GCLOUD_PASSWORD }}" - + + - name: authenticate and login to Google Cloud using service account key + run: | + echo "${{ secrets.GCLOUD_SERVICE_KEY }}" > gcloud-service-key.json + gcloud auth activate-service-account --key-file=gcloud-service-key.json + - name: set image and restart Kubernetes deployment run: | gcloud container clusters get-credentials ld-cluster-1 --region=us-central1