Skip to content
activity

GitHub Action

Google Cloud Function "Deploy code" Action for Github Action

v1 Latest version

Google Cloud Function "Deploy code" Action for Github Action

activity

Google Cloud Function "Deploy code" Action for Github Action

This Github action can be used to deploy code to Cloud Functions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Google Cloud Function "Deploy code" Action for Github Action

uses: jashparekh/cloud-functions-action@v1

Learn more about this action in jashparekh/cloud-functions-action

Choose a version

Actions Status Actions Status Actions Status Version

Cloud Function Github Action

This Github action can be used to deploy code to Cloud Functions.

Simple

name: "Deploy code to Cloud Function"
on:
  pull_request: {}
  push:
      branches: ["main"]

jobs:
  deploy_schemas:
    runs-on: ubuntu-latest
    name: Deploy code to Cloud Function
    steps:
      # To use this repository's private action,
      # you must check out the repository
      - name: Checkout
        uses: actions/[email protected]
      - name: Deploy code to Cloud Function
        uses: jashparekh/cloud-functions-action@v1
        env:
          gcp_project: "gcp-us-project"
          gcp_region: "us-central1"
          cloud_function_name: "function-1"
          cloud_function_directory: "directory/function-code"
          credentials: ${{ secrets.GCP_SERVICE_ACCOUNT }}

Configuration

Required

gcp_project (required, string)

The name of the GCP project you want to deploy.

Example: gcp-us-project

gcp_region (required, string)

GCP region where the cloud function is hosted.

Example: us-central1

cloud_function_name (required, string)

Name of the cloud function in GCP.

Example: function-1

cloud_function_directory (required, string)

The directory in your repository where are you storing the code files for cloud function.

Example: directory/function-code

credentials (required, string)

Google Service Account with permission to create objects in the specified project. Can be stored as a repository secret

Contributing

See the Contributing Guide for additional information.

To execute tests locally (requires that docker and docker-compose are installed):

docker-compose run test

Credits

This Github Action was originally written by Jash Parekh.