-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild.yaml
30 lines (25 loc) · 909 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
26
27
28
29
30
# Build process for deploying to GKE
steps:
# Npm install
- name: "gcr.io/cloud-builders/npm"
args: ["install", "--production"]
# Build production optimized site
- name: "gcr.io/cloud-builders/npm"
args: ["run", "build"]
env:
- "REACT_APP_VERSION=$TAG_NAME"
# Package Docker image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "$_REGION/$PROJECT_ID/$_IMAGE_NAME:$TAG_NAME", "."]
# Push the docker image to the registry
- name: "gcr.io/cloud-builders/docker"
args: ["push", "$_REGION/$PROJECT_ID/$_IMAGE_NAME:$TAG_NAME"]
# Perform rolling update to Kubernetes
- name: "gcr.io/cloud-builders/kubectl"
args: ["set",
"image",
"deployment/$_IMAGE_NAME",
"$_CONTAINER_NAME=$_REGION/$PROJECT_ID/$_IMAGE_NAME:$TAG_NAME"]
env:
- "CLOUDSDK_CONTAINER_CLUSTER=$_CLOUDSDK_CONTAINER_CLUSTER"
- "CLOUDSDK_COMPUTE_ZONE=$_ZONE"