-
Notifications
You must be signed in to change notification settings - Fork 10
53 lines (48 loc) · 1.6 KB
/
deploy-cloud-functions-testnet.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
name: Deploy Cloud Functions
on:
push:
branches: [ main, add-otp-cloud-functions ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.CLOUD_FUNCTIONS_DEPLOYER_TESTNET_SERVICE_ACCOUNT }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Install dependencies and build'
run: |
cd packages/functions
npm install
npm run build
echo "Directory structure after build:"
find . -type f
- name: 'Deploy Cloud Functions'
run: |
cd packages/functions
gcloud config set project pagoda-oboarding-dev
gcloud functions deploy verifyOTP \
--runtime nodejs18 \
--trigger-http \
--allow-unauthenticated \
--region=us-central1 \
--entry-point=verifyOTP \
--source=lib \
--set-env-vars GMAIL_SENDER="${{ secrets.GMAIL_OTP_SENDER }}",GMAIL_PASSWORD="${{ secrets.GMAIL_OTP_SENDER_PASSWORD }}" \
--verbosity=debug
gcloud functions deploy sendOTP \
--runtime nodejs18 \
--trigger-http \
--allow-unauthenticated \
--region=us-central1 \
--entry-point=sendOTP \
--source=lib \
--set-env-vars GMAIL_SENDER="${{ secrets.GMAIL_OTP_SENDER }}",GMAIL_PASSWORD="${{ secrets.GMAIL_OTP_SENDER_PASSWORD }}" \
--verbosity=debug