Skip to content
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

initial commit for cloudrun build and deploy workflows #244

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

cru-Luis-Rodriguez
Copy link
Contributor

@cru-Luis-Rodriguez cru-Luis-Rodriguez commented Oct 21, 2024

Build & Deploy Cloud Run Function Workflow

This repository contains a GitHub Actions workflow for building and deploying a Cloud Function to Google Cloud Run. The workflow is defined in workflow-templates/build-deploy-cloudrun-function.yml.

Workflow Configuration

The workflow is triggered on:

  • Push events to the $default-branch.
  • Manual dispatch via the GitHub Actions interface.

Inputs

  • function_name: The name of the Cloud Function to deploy (required).
  • entry_point: The Python function serving as the entry point (required).
  • runtime: The function runtime (required).

Secrets

The following secrets must be configured in your GitHub repository:

  • GCP_PROJECT_ID
  • GCP_PROJECT_NUMBER
  • WORKLOAD_IDENTITY_POOL
  • WORKLOAD_IDENTITY_PROVIDER
  • GCP_SERVICE_ACCOUNT
  • GCP_SERVICE_ACCOUNT_EMAIL
  • GCP_REGION

Notes

  • Ensure that all required secrets are configured in your GitHub repository.
  • Update the paths and inputs as necessary to match your project structure and requirements.

@mattdrees
Copy link
Member

Cool, thanks for working on this. I'd be happy to have you own the GHA deployment stuff.

On the plane I was starting to work on a gha workflow, but I didn't think of putting in our org .github directory. I will have to research when it's appropriate to put things here vs the repo itself.

I think the flow of what you have here is super close to what I was drafting.
Main difference is that mine doesn't do docker building; I let Cloud Functions do that part internally. Mine pretty much just calls 'glcoud functions deploy'. I'll commit mine in a draft PR in the other repo and point you toward it, for comparison's sake.

@mattdrees
Copy link
Member

Here's my WIP draft:
CruGlobal/dot@2ba57e0

@cru-Luis-Rodriguez
Copy link
Contributor Author

@mattdrees As far as where to store the build and deploy workflow. I lean toward setting it here so that other repos can use it without duplicating the process.
I've incorporated your deployment process and opted to use the gcloud functions deployment. I'll refactor the build-deploy-cloudrun-job.yml so that it is obvious it uses the docker build. That way, we can have both options.

Copy link
Member

@mattdrees mattdrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look at it more tonight

.github/workflows/build-deploy-cloudrun-function.yml Outdated Show resolved Hide resolved
@mattdrees mattdrees force-pushed the gcp-cloudrun branch 2 times, most recently from 9774394 to 1cba2f3 Compare October 28, 2024 19:26
@cru-Luis-Rodriguez cru-Luis-Rodriguez marked this pull request as ready for review October 29, 2024 20:55
@cru-Luis-Rodriguez
Copy link
Contributor Author

@mattdrees @Omicron7 ready for review.

@cru-Luis-Rodriguez cru-Luis-Rodriguez merged commit 3b222da into main Oct 30, 2024
1 check passed
@cru-Luis-Rodriguez cru-Luis-Rodriguez deleted the gcp-cloudrun branch October 30, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants