feat: Use shared action for local deploy#2
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
| firebase use prod --non-interactive | ||
| else | ||
| firebase use staging --non-interactive | ||
| if ! echo "$service_account_b64" | base64 --decode > /dev/null 2>&1; then |
There was a problem hiding this comment.
I'm trying to add validation for base64 encoding here. Let me know what you think of this approach.
action.yml
Outdated
| echo '${{ inputs.service_account_json_b64 }}' | base64 -d | jq '.' > service-account.json | ||
| echo "GOOGLE_APPLICATION_CREDENTIALS=service-account.json" >> $GITHUB_ENV | ||
| gcloud auth activate-service-account --key-file=service-account.json | ||
| rm -f service-account.json |
There was a problem hiding this comment.
We still need this here. The JSON key will be cleaned up at the end of the workflow.
There was a problem hiding this comment.
What uses the json after this?
There was a problem hiding this comment.
Good question. I thought the environment variable stores a reference to the JSON, which Firebase uses in later steps. I must have misunderstood.
There was a problem hiding this comment.
I added this line back in, but got:
Error: Failed to authenticate, have you run firebase login?
|
I added two more keys, which are base 64 encoded: |
PR Type
Enhancement
Description
Simplify deploy steps using shared action
Remove manual Node.js, Firebase CLI setup
Consolidate authentication and deployment logic
Pass environment and credentials inputs
Changes walkthrough 📝
deploy-functions.yml
Simplify deployment workflow via shared action.github/workflows/deploy-functions.yml