-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Use shared action for local deploy #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What uses the json after this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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