forked from cohere-ai/cohere-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 2.01 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
60
61
62
63
64
65
66
67
68
name: Deploy Backend
on:
release:
types: [published]
workflow_dispatch:
inputs:
tags:
description: 'Branch or tag (e.g: v0.0.1)'
required: false
type: string
jobs:
deploy:
runs-on: ubuntu-latest
# needs: build-and-push-backend-image
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Set up environment variables
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> $GITHUB_ENV
echo "COHERE_API_KEY=${{ secrets.COHERE_API_KEY }}" >> $GITHUB_ENV
echo "GCP_PROJECT_ID=${{ secrets.GCP_PROJECT_ID }}" >> $GITHUB_ENV
echo "IMAGE_TAG=${{ github.event.inputs.tags }}" >> $GITHUB_ENV
# Deploy the image to Cloud Run
- name: Deploy to Cloud Run
# env:
# Database_URL: ${{ secrets.DATABASE_URL }}
# COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
# IMAGE_NAME: ${{ env.IMAGE_NAME }}
run: |
gcloud run deploy ${{ env.IMAGE_NAME }} \
--project=${{ env.GCP_PROJECT_ID }} \
--image=${{ env.meta.outputs.tags }} \
--platform=managed \
--region=us-central1 \
--allow-unauthenticated \
--update-env-vars=DATABASE_URL=${{ env.DATABASE_URL }},COHERE_API_KEY=${{ env.COHERE_API_KEY }} \
--memory=4Gi \
--cpu=4 \
--max-instances=1
# steps:
# - name: Login
# uses: google-github-actions/setup-gcloud@v0
# with:
# project_id: ${{ vars.GCP_PROJECT_ID }}
# service_account_email: [email protected]
# service_account_key: ${{ secrets.GCP_SA_KEY }}
# - name: Checkout repository
# uses: actions/checkout@v2
# Deploy the image to Cloud Run