forked from cohere-ai/cohere-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.57 KB
/
deploy_backend.yml
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
name: Deploy Backend
on:
release:
types: [published]
workflow_dispatch:
inputs:
tags:
description: 'Branch or tag (e.g: v0.0.1)'
required: false
type: string
env:
IMAGE_NAME: cohere-toolkit-backend
jobs:
deploy:
runs-on: ubuntu-latest
# needs: build-and-push-backend-image
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Configure Docker
run: gcloud auth configure-docker
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}
# Deploy the image to Cloud Run
- name: Deploy to Cloud Run
run: |
gcloud run deploy ${{ env.IMAGE_NAME }} \
--project=${{ vars.GCP_PROJECT_ID }} \
--image=${{ steps.meta.outputs.tags }} \
--platform=managed \
--region=us-central1 \
--allow-unauthenticated \
--update-env-vars=DATABASE_URL=${{ secrets.DATABASE_URL }},COHERE_API_KEY=${{ secrets.COHERE_API_KEY }},MINIMAP_API_URL=${{ vars.MINIMAP_API_URL }} \
--memory=4Gi \
--cpu=4 \
--max-instances=1