From 7b615cabed67079689e38624a609976c7d873d59 Mon Sep 17 00:00:00 2001 From: shadabmalikshah <97905885+shadabmalikshah@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:41:56 +0530 Subject: [PATCH] Update GCP_GKE.yml --- .github/workflows/GCP_GKE.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/GCP_GKE.yml b/.github/workflows/GCP_GKE.yml index fd5e727..38f2412 100644 --- a/.github/workflows/GCP_GKE.yml +++ b/.github/workflows/GCP_GKE.yml @@ -16,13 +16,17 @@ jobs: - name: Set up Google Cloud SDK uses: google-github-actions/setup-gcloud@v1 with: - project_id: ${{ secrets.GCP_PROJECT_ID }} # Your GCP Project ID secret - service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} # Service account key file (JSON) + project_id: ${{ secrets.GCP_PROJECT_ID }} export_default_credentials: true - + + - name: Create service account key file + run: | + echo "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" > $HOME/gcloud-service-key.json + cat $HOME/gcloud-service-key.json # Verify the file content (for debugging) + - name: Authenticate with Google Cloud run: | - gcloud auth activate-service-account --key-file=${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + gcloud auth activate-service-account --key-file=$HOME/gcloud-service-key.json gcloud config set project ${{ secrets.GCP_PROJECT_ID }} - name: Configure Kubectl