-
Notifications
You must be signed in to change notification settings - Fork 0
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
GCP function deployment via workflows #30
Conversation
✅ Deploy Preview for gene-plexus canceled.
|
I'll try forking this and testing it, short of actually providing the secrets and deploying to GCP. |
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.
Well, couldn't test much with a fake GCP key, but it seems to look as expected.
Suggestion: I've been adding this to all my workflows now because it's very handy. If a job fails (or even if it doesn't) you can re-run with debug logging enabled, and it'll trigger this action where it'll pause the workflow and allow you to ssh into the runner.
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3
Generally I put it before any critical or likely-to-fail actions.
…nctions deploy, since the action doesn't support gen2 functions
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.
Thanks for the comments, @vincerubinetti! FYI, I merged latest main
into this branch so that the entrypoint you mentioned would be renamed in this PR; apparently I started this PR before that other one was merged.
Also, just FYI, I tested the function deployment and, after a few tweaks, I was able to deploy gpz-convert-ids
successfully. Just for future reference, the changes were the following:
- the
cloud-function-deployer
service account ("SA") needs to haveService Account User
permissions on the SA that runs the function, i.e.logging-monitoring
- the GH action I was trying to use apparently isn't compatible with Gen 2 functions, which is strange since they've been GA for 2+ years now...anyway, the regular
gcloud function deploy
command that was being used in those deploy scripts works fine, so I switched over to that.
Neat! I put it before the deploy line in the function deploy helper workflow, since I could imagine us wanting to investigate the filesystem if a deploy failed or if the function was acting strangely. Kind of a small thing: I'm using the GitHub Actions extension for VS Code, and it flags the line |
Hmm idk what that warning is about but I've never had that action throw an error in any workflow, debug mode or not. |
Closes #5
This PR adds one workflow per function (i.e., one for
convert-ids
and one forml
) that redeploys the function whenever anything is merged intomain
that alters the function's code.The PR includes a helper workflow,
helper-deploy-func.yaml
, which does the following:cloud-function-deployer
service account, via a service account credentials file stored as a secret in this repoEach function mentioned above uses the function deployer helper workflow to minimize code duplication.