-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcloudbuild.yaml
52 lines (46 loc) · 1.38 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Important information
#
# As of 2024-12-15, this Cloud Build pipeline doesn't wait for GH Actions to
# finish running and pushing the latest Docker image to the registry before
# updating the deployment.
#
# In practice, this is hardly a big deal. It just means the latest deployment
# lags behind by one commit (usually, but can be more).
options:
machineType: "N1_HIGHCPU_32"
logging: CLOUD_LOGGING_ONLY
timeout: 1800s
steps:
# Set the project ID
- name: 'gcr.io/cloud-builders/gcloud'
args: ['config', 'set', 'project', 'graph-mainnet']
# Authenticate to GKE cluster
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'container'
- 'clusters'
- 'get-credentials'
- 'testnet'
- '--zone=us-central1-a'
- '--project=graph-mainnet'
# Update the deployment to use the latest image
- name: 'gcr.io/cloud-builders/kubectl'
args:
- 'set'
- 'image'
- 'deployment/graphix'
- 'graphix=ghcr.io/${_GITHUB_REPO_OWNER}/graphix:latest'
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=testnet'
# Restart the deployment
- name: 'gcr.io/cloud-builders/kubectl'
args:
- 'rollout'
- 'restart'
- 'deployment/graphix'
env:
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=testnet'
substitutions:
_GITHUB_REPO_OWNER: 'edgeandnode'