Skip to content

Commit 491af38

Browse files
committed
fc
1 parent 6046bf1 commit 491af38

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

.github/workflows/ci-cd.yaml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,6 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

31-
# Install kubectl
32-
- name: Install kubectl
33-
run: |
34-
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
35-
chmod +x ./kubectl
36-
sudo mv ./kubectl /usr/local/bin/kubectl
37-
38-
# Install gke-gcloud-auth-plugin
39-
- name: Install gke-gcloud-auth-plugin
40-
run: |
41-
gcloud components install gke-gcloud-auth-plugin --quiet
42-
4331
# Authenticate to Google Cloud
4432
- id: 'auth'
4533
name: 'Authenticate to Google Cloud'
@@ -54,6 +42,11 @@ jobs:
5442
- name: Set up Cloud SDK
5543
uses: google-github-actions/setup-gcloud@v2
5644

45+
# Install kubectl
46+
- name: Install kubectl
47+
run: |
48+
gcloud components install kubectl --quiet
49+
5750
# Configure Docker for Artifact Registry
5851
- name: Configure Docker
5952
run: |
@@ -199,7 +192,7 @@ jobs:
199192
run: |
200193
cat /tmp/pipeline_metrics
201194
202-
# Push Pipeline Metrics
195+
# Add at the end of the workflow
203196
- name: Push Pipeline Metrics
204197
if: ${{ env.SKIP_METRICS != 'true' }}
205198
run: |
@@ -221,13 +214,6 @@ jobs:
221214
- name: Checkout code
222215
uses: actions/checkout@v4
223216

224-
# Install kubectl
225-
- name: Install kubectl
226-
run: |
227-
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
228-
chmod +x ./kubectl
229-
sudo mv ./kubectl /usr/local/bin/kubectl
230-
231217
# Authenticate to Google Cloud
232218
- id: 'auth'
233219
name: 'Authenticate to Google Cloud'
@@ -236,6 +222,12 @@ jobs:
236222
credentials_json: '${{ secrets.GCP_SA_KEY }}'
237223
token_format: 'access_token'
238224

225+
# Install kubectl
226+
- name: Install kubectl
227+
run: |
228+
gcloud components install kubectl
229+
gcloud components install gke-gcloud-auth-plugin
230+
239231
# Get GKE Credentials with error handling
240232
- name: Get GKE Credentials
241233
run: |

0 commit comments

Comments
 (0)