forked from karthilxg/chess-trainer-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
25 lines (21 loc) · 908 Bytes
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'us-central1-docker.pkg.dev/$PROJECT_ID/chessbook/frontend:latest', '.']
automapSubstitutions: true
# Add the step for pushing the Docker image to GCR
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-central1-docker.pkg.dev/$PROJECT_ID/chessbook/frontend:latest']
# Authenticate with the GKE cluster
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args:
- '-c'
- |
gcloud container clusters get-credentials $_CLUSTER_NAME --zone $_CLUSTER_ZONE --project $PROJECT_ID
kubectl apply -f deploy.yml
kubectl rollout restart deployment chess-frontend
images:
- 'us-central1-docker.pkg.dev/$PROJECT_ID/chessbook/frontend:latest'
substitutions:
_CLUSTER_NAME: 'chessbook-cluster' # replace with your actual cluster name
_CLUSTER_ZONE: 'us-east1' # replace with your actual cluster zone