Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit d256dca

Browse files
authored
Update ci/cd pipelines with gke auth plugin
1 parent f279125 commit d256dca

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

.github/workflows/prod.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,27 @@ jobs:
7777
# delete bakup file
7878
rm "$SERVICE.yaml.bak"
7979
80+
- name: Enable auth plugin
81+
run: |
82+
echo "USE_GKE_GCLOUD_AUTH_PLUGIN=True" >> $GITHUB_ENV
83+
84+
# Auth to GKE
85+
- name: Authenticate to GKE
86+
uses: google-github-actions/auth@v1
87+
with:
88+
project_id: wire-bot
89+
credentials_json: ${{ secrets.GKE_SA_KEY }}
90+
service_account: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com
91+
8092
# Setup gcloud CLI
8193
- name: Set up Cloud SDK
82-
uses: google-github-actions/setup-gcloud@v0
83-
with:
84-
service_account_email: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com
85-
service_account_key: ${{ secrets.GKE_SA_KEY }}
86-
project_id: wire-bot
87-
export_default_credentials: true
94+
uses: google-github-actions/setup-gcloud@v1
8895

89-
# Configure Docker to use the gcloud command-line tool
90-
- name: Configure Docker Google cloud
96+
# Prepare components
97+
- name: Prepare gcloud components
9198
run: |
99+
gcloud components install gke-gcloud-auth-plugin
100+
gcloud components update
92101
gcloud --quiet auth configure-docker
93102
94103
# Get the GKE credentials so we can deploy to the cluster

.github/workflows/staging.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,27 @@ jobs:
5050
build-args: |
5151
release_version=${{ env.RELEASE_VERSION }}
5252
53+
- name: Enable auth plugin
54+
run: |
55+
echo "USE_GKE_GCLOUD_AUTH_PLUGIN=True" >> $GITHUB_ENV
56+
57+
# Auth to GKE
58+
- name: Authenticate to GKE
59+
uses: google-github-actions/auth@v1
60+
with:
61+
project_id: wire-bot
62+
credentials_json: ${{ secrets.GKE_SA_KEY }}
63+
service_account: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com
64+
5365
# Setup gcloud CLI
5466
- name: Set up Cloud SDK
55-
uses: google-github-actions/setup-gcloud@v0
56-
with:
57-
service_account_email: kubernetes-deployment-agent@wire-bot.iam.gserviceaccount.com
58-
service_account_key: ${{ secrets.GKE_SA_KEY }}
59-
project_id: wire-bot
60-
export_default_credentials: true
67+
uses: google-github-actions/setup-gcloud@v1
6168

62-
# Configure Docker to use the gcloud command-line tool
63-
- name: Configure Docker Google cloud
69+
# Prepare components
70+
- name: Prepare gcloud components
6471
run: |
72+
gcloud components install gke-gcloud-auth-plugin
73+
gcloud components update
6574
gcloud --quiet auth configure-docker
6675
6776
# Get the GKE credentials so we can deploy to the cluster

0 commit comments

Comments
 (0)