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 2186001 commit eadfaa1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/GCP_GKE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true

- name: Authenticate with Google Cloud
run: |
echo "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" > $HOME/gcloud-service-key.json
gcloud auth activate-service-account --key-file=$HOME/gcloud-service-key.json
gcloud config set project ${{ secrets.GCP_PROJECT_ID }}
- name: Install gke-gcloud-auth-plugin
run: |
sudo apt-get update
sudo apt-get install -y google-cloud-sdk-gke-gcloud-auth-plugin
- name: Configure Kubectl
run: |
Expand Down

0 comments on commit eadfaa1

Please sign in to comment.