AEGIS-SECURE-API / cloudbuild.yaml
Akshat Bhatt
added code
e2e0c18
steps:
# Build the Docker image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:$SHORT_SHA'
- '-t'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:latest'
- '.'
dir: '.'
# Push the Docker image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:$SHORT_SHA'
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:latest'
# Deploy to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'deploy'
- 'phishing-detection-api'
- '--image'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:$SHORT_SHA'
- '--region'
- 'us-central1'
- '--platform'
- 'managed'
- '--allow-unauthenticated'
- '--memory'
- '4Gi'
- '--cpu'
- '2'
- '--timeout'
- '300'
- '--max-instances'
- '10'
- '--set-env-vars'
- 'PYTHONUNBUFFERED=1'
- '--set-secrets'
- 'GROQ_API_KEY=GROQ_API_KEY:latest'
images:
- 'gcr.io/$PROJECT_ID/phishing-detection-api:$SHORT_SHA'
- 'gcr.io/$PROJECT_ID/phishing-detection-api:latest'
options:
machineType: 'E2_HIGHCPU_8'
logging: CLOUD_LOGGING_ONLY
timeout: '1200s'