Google Cloud Functions allows you to deploy small logical units of code (i.e. functions). While it is already possible to deploy these functions from a Google Cloud Storage bucket or directly from the inline editor (e.g. for prototyping purposes), did you know that you can take advantage of the Google Cloud Repository to host the Cloud Functions source code and automate these deployments? You could for instance trigger a new deploy after each git push
.
Let's see how.
We'll assume you already have a working Google Cloud Repository (how to setup a Cloud Repository) with the following configuration:
- projectID:
project-123
- repository name:
default
- default branch:
master
- function name:
function-123