-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcloudbuild.yaml
48 lines (44 loc) · 1.63 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
steps:
# Build and push backend image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/makeitjakes-backend', './backend']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/makeitjakes-backend']
# Build and push frontend image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/makeitjakes-frontend', './frontend']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/makeitjakes-frontend']
# Deploy backend to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'makeitjakes-backend'
- '--image'
- 'gcr.io/$PROJECT_ID/makeitjakes-backend'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
- '--set-env-vars'
- 'RAILS_ENV=production,RAILS_LOG_TO_STDOUT=true,RAILS_SERVE_STATIC_FILES=true,REDIS_URL=redis://10.188.33.171:6379'
- '--set-secrets'
- 'RAILS_MASTER_KEY=rails-master-key:latest,SECRET_KEY_BASE=rails-secret-key-base:latest,ANTHROPIC_API_KEY=anthropic-api-key:latest,FIREWORKS_API_KEY=fireworks-api-key:latest,GEMINI_API_KEY=gemini-api-key:latest'
# Deploy frontend to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- 'run'
- 'deploy'
- 'makeitjakes-frontend'
- '--image'
- 'gcr.io/$PROJECT_ID/makeitjakes-frontend'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
images:
- 'gcr.io/$PROJECT_ID/makeitjakes-backend'
- 'gcr.io/$PROJECT_ID/makeitjakes-frontend'