Created
January 20, 2020 17:12
-
-
Save ryderdamen/53cf484c390469ab98dd203d15657022 to your computer and use it in GitHub Desktop.
An example CircleCI Config file for deploying a Google Cloud Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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