-
Notifications
You must be signed in to change notification settings - Fork 23
64 lines (52 loc) · 1.7 KB
/
cd.dev-functions.yaml
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
name: Deploy Serverless Function
on:
push:
branches:
- chore/serverless-function
pull_request:
types: [closed]
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: "actions/checkout@v4"
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Export requirements.txt from Poetry
run: poetry export --without-hashes --format=requirements.txt > ./autotx/serverless_functions/requirements.txt
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ secrets.GOOGLE_WIP }}
service_account: ${{ secrets.GOOGLE_SA }}
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
with:
version: ">= 474.0.0"
- name: "Use gcloud CLI"
run: "gcloud info"
- name: "Deploy get_user_tasks function"
run: |
gcloud functions deploy get_user_tasks \
--project=autotx-423210 \
--gen2 \
--source=autotx/serverless_functions \
--runtime=python310 \
--region=us-central1 \
--trigger-http \
--allow-unauthenticated \
--entry-point=get_user_tasks \
--set-env-vars SUPABASE_URL="${{ secrets.DEV_SUPABASE_URL }}",SUPABASE_SERVICE_ROLE_KEY="${{ secrets.DEV_SUPABASE_SERVICE_ROLE_KEY }}"