How To Deploy Google Cloud Functions from CircleCI

Create A Service Account and Keys

Login to your console and select “Service Accounts” from the IAM & admin menu.
Click the “CREATE SERVICE ACCOUNT” button to create a service account.
Click the create button to create the service account — you’ll be taken to the next screen in the wizard.
Assign the “Cloud Functions Developer” and “Service Account User” roles, so the service account can perform deployment actions.

Enable The Cloud Functions API

Create the CircleCI Project and Add Environment Variables

An example .circleci/config.yaml file for deploying the src directory to Google Cloud Functions.

Setting Up The CircleCI Project

Set Environment Variables

cat the_service_account_file.json | base64
Don’t share this key with anyone — even the base64 encoded version. (This key can be shared because it has already been destroyed).

Deployment

A completed deployment from the CircleCI console.
The deployed cloud function.

Questions?

--

--

--

Ryder Damen is a DevOps engineer by day, and also a DevOps engineer by night. He enjoys travelling, trying new things and making the web a stranger place.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Community Mojo

My Rails Project

Build Sound Open Firmware on MinnowBoard

Dynamic Template Generator for Elasticsearch

Image of Kibana Visual field selector drop-down with too many fields.

Unit testing with the Hypothesis library

Creating Modular Powerup Systems

15 General Interview Questions for a Frontend Developer in 2019

3 Things to learn while Programming.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ryder Damen

Ryder Damen

Ryder Damen is a DevOps engineer by day, and also a DevOps engineer by night. He enjoys travelling, trying new things and making the web a stranger place.

More from Medium

My journey learning Google Cloud Platform

Way to Lower Cloud SQL InstanceCost

Automating continuous deployments for setting up infrastructure

Cloud infrastructure automation

GCP pub/sub Architecture Understanding