Skip to content

Commit

Permalink
Update GCP_GKE.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shadabmalikshah authored Dec 29, 2024
1 parent e617e4c commit 7b615ca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/GCP_GKE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b615ca

Please sign in to comment.