-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.43 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
name: "[BACKEND] Deploy Cloud Run"
on:
push:
branches: [main]
paths:
- backend/**
workflow_dispatch:
defaults:
run:
working-directory: backend
env:
SERVICE_NAME: kg1-backend
GCP_PROJECT: kg1-prod
GCP_PROJECT_ID: kg1-prod-405611
GCP_REGION: europe-west1
jobs:
deploy:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup GCP Auth
uses: google-github-actions/auth@v1
with:
export_environment_variables: true
project_id: ${{ env.GCP_PROJECT_ID }}
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Setup GCP SDK
uses: google-github-actions/setup-gcloud@v1
with:
version: latest
install_components: beta
project_id: ${{ env.GCP_PROJECT_ID }}
- name: Deploy Container to GCP
run: |
gcloud run deploy ${{ env.SERVICE_NAME }} \
--source . \
--project ${{ env.GCP_PROJECT }} \
--region ${{ env.GCP_REGION }} \
--set-env-vars OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
--set-env-vars DATABASE_URL=${{ secrets.DATABASE_URL }} \
--set-env-vars DATABASE_URL_DIRECT=${{ secrets.DATABASE_URL_DIRECT }} \
--set-env-vars OPENAI_API_CALL_LIMIT=1000 \
--set-env-vars NODE_COUNT_LIMIT=10000