Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dongitran committed Nov 27, 2023
1 parent 86d8df3 commit 98cbc78
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/deploy-kubernetes-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,26 @@ jobs:
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcloud.json
./google-cloud-sdk/bin/gcloud config set project ${{ secrets.GCP_PROJECT_ID }}
- name: Configure Docker CLI
run: |
./google-cloud-sdk/bin/gcloud auth configure-docker
- name: Install kubectl plugin
run: |
./google-cloud-sdk/bin/gcloud components install kubectl
- name: Set kubectl context
run: |
gcloud container clusters get-credentials autopilot-cluster-1 --region asia-southeast1 --project cdtest-406103
./google-cloud-sdk/bin/gcloud container clusters get-credentials ${{ secrets.GCP_CLUSTER_NAME }} --zone ${{ secrets.GCP_CLUSTER_ZONE }} --project ${{ secrets.GCP_PROJECT_ID }}
- name: Configure kubectl
run: |
gcloud auth activate-service-account --key-file=/tmp/gcloud.json
kubectl config set-credentials gke-cluster-user --token=$(gcloud auth print-access-token)
kubectl config set-context gke-cluster --cluster=gke_cluster --user=gke-cluster-user
kubectl config use-context gke-cluster
- name: Deploy to Kubernetes
run: |
ls
pwd
kubectl apply -f deployment.yaml
sudo kubectl apply -f deployment.yaml

0 comments on commit 98cbc78

Please sign in to comment.