File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Firebase Service Account Credentials
2+
3+ TYPE = service_account
4+ PROJECT_ID = your-project-id
5+ PRIVATE_KEY_ID = your-private-key-id
6+ PRIVATE_KEY = -----BEGIN PRIVATE KEY-----\\nYOUR_KEY_LINE_1\\nYOUR_KEY_LINE_2\\n-----END PRIVATE KEY-----\\n
7+ CLIENT_EMAIL = your-service-account@your-project.iam.gserviceaccount.com
8+ CLIENT_ID = your-client-id
9+ AUTH_URI = https://accounts.google.com/o/oauth2/auth
10+ TOKEN_URI = https://oauth2.googleapis.com/token
11+ AUTH_PROVIDER_CERT_URL = https://www.googleapis.com/oauth2/v1/certs
12+ CLIENT_CERT_URL = https://www.googleapis.com/robot/v1/metadata/x509/your-service-account%40your-project.iam.gserviceaccount.com
13+
14+ # Firebase Realtime Database URL
15+ DATABASE_URL = https://your-project-id-default-rtdb.firebaseio.com/
Original file line number Diff line number Diff line change 11name : Vercel Preview Deployment
22
3- env :
4- VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
5- VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
6-
73on :
8- push :
9- branches-ignore :
10- - main
4+ push :
5+ branches-ignore :
6+ - main
117
128jobs :
13- Deploy-Preview :
14- runs-on : ubuntu-latest
15- steps :
9+ Deploy-Preview :
10+ runs-on : ubuntu-latest
11+ env :
12+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
13+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
1614
17- - uses : actions/checkout@v3
15+ steps :
16+ - uses : actions/checkout@v3
1817
19- - name : Install Vercel CLI
20- run : npm install --global vercel
18+ - name : Install Vercel CLI
19+ run : npm install --global vercel
2120
22- - name : Pull Vercel Environment Information
23- run : vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
21+ - name : Pull Vercel Environment Information
22+ run : vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
2423
25- - name : Build Project Artifacts
26- run : vercel build --token=${{ secrets.VERCEL_TOKEN }}
24+ - name : Build Project Artifacts
25+ run : vercel build --token=${{ secrets.VERCEL_TOKEN }}
2726
28- - name : Deploy Project Artifacts
29- run : vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
27+ - name : Deploy Project Artifacts
28+ run : vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }}
Original file line number Diff line number Diff line change 11name : Vercel Production Deployment
22
3- env :
4- VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
5- VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
6-
73on :
84 push :
95 branches :
128jobs :
139 Deploy-Production :
1410 runs-on : ubuntu-latest
15- steps :
11+ env :
12+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
13+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
1614
15+ steps :
1716 - name : Checkout repository
1817 uses : actions/checkout@v3
1918
20- - name : Set up Python
21- uses : actions/setup-python@v4
22- with :
23- python-version : ' 3.13.3'
24-
25- - name : Install Python dependencies
26- run : |
27- python3 -m pip install --upgrade pip
28- pip install -r requirements.txt
29-
3019 - name : Install Vercel CLI
3120 run : npm install --global vercel
3221
Original file line number Diff line number Diff line change 1- credentials.json
21.vercel
2+ .env
Original file line number Diff line number Diff line change 55from phonenumbers import PhoneNumberFormat
66import uuid
77from datetime import datetime
8-
9- cred = credentials .Certificate ("credentials.json" )
10- firebase_admin .initialize_app (cred , {"databaseURL" : "https://if-project-3ded1-default-rtdb.firebaseio.com/" })
8+ import os
9+ from dotenv import load_dotenv
10+
11+ load_dotenv ()
12+
13+ cred_info = {
14+ "type" : os .getenv ("TYPE" ),
15+ "project_id" : os .getenv ("PROJECT_ID" ),
16+ "private_key_id" : os .getenv ("PRIVATE_KEY_ID" ),
17+ "private_key" : os .getenv ("PRIVATE_KEY" ).replace ("\\ n" , "\n " ),
18+ "client_email" : os .getenv ("CLIENT_EMAIL" ),
19+ "client_id" : os .getenv ("CLIENT_ID" ),
20+ "auth_uri" : os .getenv ("AUTH_URI" ),
21+ "token_uri" : os .getenv ("TOKEN_URI" ),
22+ "auth_provider_x509_cert_url" : os .getenv ("AUTH_PROVIDER_CERT_URL" ),
23+ "client_x509_cert_url" : os .getenv ("CLIENT_CERT_URL" )
24+ }
25+
26+ cred = credentials .Certificate (cred_info )
27+ firebase_admin .initialize_app (cred , {"databaseURL" : os .getenv ("DATABASE_URL" )})
1128
1229ref = db .reference ("/" )
1330agenda_ref = ref .child ('agenda' )
Original file line number Diff line number Diff line change 11fastapi [standard ]
22firebase_admin
3- phonenumbers
3+ phonenumbers
4+ python-dotenv
You can’t perform that action at this time.
0 commit comments