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