Skip to content

Commit

Permalink
Fix deploy functions 13
Browse files Browse the repository at this point in the history
  • Loading branch information
yevkim committed Nov 27, 2024
1 parent 163b3bd commit 5a4f321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
# Step 6: deploy functions
- name: Deploy functions
working-directory: backend
run: |
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/gcloud.json
echo "GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS"
cat $GOOGLE_APPLICATION_CREDENTIALS
npx firebase-tools deploy --only functions --debug --token "${{ secrets.FIREBASE_TOKEN_SCHEMESSG_V3_DEV }}"
env:
GOOGLE_APPLICATION_CREDENTIALS: $HOME/gcloud.json
run: npx firebase-tools deploy --only functions --debug --token "${{ secrets.FIREBASE_TOKEN_SCHEMESSG_V3_DEV }}"
4 changes: 4 additions & 0 deletions backend/functions/fb_manager/firebaseManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def _initialize_app(self):
# Replace newlines in private key
# private_key = os.getenv("FB_PRIVATE_KEY").replace("\\n", "\n")
path_to_creds = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")

if not path_to_creds or not os.path.exists(path_to_creds):
raise ValueError(f"Invalid certificate path: {path_to_creds}. Make sure GOOGLE_APPLICATION_CREDENTIALS is set properly.")

cred = credentials.Certificate(path_to_creds) # Adjust path as needed

# cred = credentials.Certificate(
Expand Down

0 comments on commit 5a4f321

Please sign in to comment.