Skip to content

Instantly share code, notes, and snippets.

@ryderdamen
Created January 20, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryderdamen/53cf484c390469ab98dd203d15657022 to your computer and use it in GitHub Desktop.
Save ryderdamen/53cf484c390469ab98dd203d15657022 to your computer and use it in GitHub Desktop.
An example CircleCI Config file for deploying a Google Cloud Function
version: 2
jobs:
deploy:
docker:
- image: google/cloud-sdk
steps:
- checkout
- run:
name: Authorize GCloud Command Line Tool
command: |
echo $GCLOUD_SERVICE_KEY | base64 --decode | gcloud auth activate-service-account --key-file=-
- run:
name: Deploy To Google Cloud Functions
command: |
# Variables
FUNCTION_NAME=circleci_deployment_example
ENTRYPOINT=main
GCP_PROJECT=circleci-gcf-deployment
# Deploy command
gcloud functions deploy $FUNCTION_NAME \
--entry-point $ENTRYPOINT \
--runtime python37 \
--trigger-http \
--source ./src/ \
--project $GCP_PROJECT
workflows:
version: 2
build-test-and-deploy:
jobs:
- deploy:
filters:
branches:
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment