ohmybuck

Deploy a GCP Cloud Function from Github

June 30, 2020

Create a github directory and add the following:

  1. The build spec ./cloudbuild.yaml

    steps:
     - name: "gcr.io/cloud-builders/gcloud"
       args:
         - functions
         - deploy
         - [function_name]
         - --source=.
         - --region=europe-west1
         - --entry-point=main
         - --trigger-http
         - --runtime=python37
         - --allow-unauthenticated
  2. Function ./main.py

    def main ():
       return "hello"
  3. Add a trigger to GCP

Done!


Written by Oliver Smit. I love talking about web technologies, good design practices, optimising productivity, and rapid prototyping of projects. Check out my work on Github