Skip to content

Commit 57c7a46

Browse files
authored
Code generation tool cloud function (#4962)
1 parent 14dd011 commit 57c7a46

File tree

6 files changed

+422
-867
lines changed

6 files changed

+422
-867
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Code Generation Function
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Google Cloud Auth
17+
id: auth
18+
uses: google-github-actions/auth@v2
19+
with:
20+
credentials_json: ${{ secrets.GCP_SA_CREDENTIALS }}
21+
22+
- name: Set up gcloud
23+
uses: google-github-actions/setup-gcloud@v2
24+
25+
- name: Deploy to Cloud Functions
26+
working-directory: functions/code_generation
27+
run: |
28+
gcloud functions deploy code-generation \
29+
--gen2 \
30+
--trigger-http \
31+
--allow-unauthenticated \
32+
--region=us-central1 \
33+
--timeout=300 \
34+
--memory=2Gi \
35+
--runtime=python311 \
36+
--entry-point=handle_phabricator_webhook \
37+
--service-account=review-helper@moz-bugbug.iam.gserviceaccount.com \
38+
--set-secrets=OPENAI_API_KEY=openai-api-key:latest

0 commit comments

Comments
 (0)