-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
65 lines (57 loc) · 2.2 KB
/
cloudbuild.yaml
File metadata and controls
65 lines (57 loc) · 2.2 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
# This file is the recipe for Cloud Build to build, push, and deploy your app.
steps:
# Step 1: Build the Docker image using the Dockerfile in your repository.
# The image is tagged with a fixed tag for now
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '--platform'
- 'linux/amd64'
- '-t'
- 'gcr.io/synapse-docs-468420/synapse-docs:latest'
- '.'
# Step 2: Push the newly built image to Google Container Registry.
# This makes the image available for Cloud Run to pull.
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/synapse-docs-468420/synapse-docs:latest'
# Step 3: Deploy the image to Cloud Run, configuring it with secrets and storage.
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'synapse-docs'
- '--image=gcr.io/${PROJECT_ID}/synapse-docs:latest'
- '--region=us-central1'
- '--platform=managed'
- '--port=8080'
- '--allow-unauthenticated'
- '--min-instances=0'
- '--max-instances=2'
- '--cpu=2'
- '--memory=8Gi'
- '--timeout=600'
- '--concurrency=10'
# Add Cloud Storage volume for persistent data
- '--add-volume=name=synapse-data-vol,type=cloud-storage,bucket=synapse-docs-data-midhunan'
# Mount the volume to /app/data
- '--add-volume-mount=volume=synapse-data-vol,mount-path=/app/data'
# Set secrets as environment variables
- '--update-secrets=ADOBE_CLIENT_ID=adobe-client-id:latest'
- '--update-secrets=GOOGLE_APPLICATION_CREDENTIALS=gemini-api-key:latest'
- '--update-secrets=AZURE_TTS_KEY=azure-tts-key:latest'
- '--update-secrets=AZURE_TTS_ENDPOINT=azure-tts-endpoint:latest'
# Set regular environment variables
- '--set-env-vars=LLM_PROVIDER=gemini'
- '--set-env-vars=GEMINI_MODEL=gemini-2.5-flash'
- '--set-env-vars=TTS_PROVIDER=azure'
# Tell Cloud Build which images were created to store them.
images:
- 'gcr.io/synapse-docs-468420/synapse-docs:latest'
# Increase the timeout for the deployment step if needed.
options:
machineType: 'N1_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
timeout: '1200s'