Skip to content

helmless/google-cloudrun-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Helmless.io - Serverless Deployments Without Compromise

helmless/google-cloudrun-action

Version License

The helmless/google-cloudrun-action is a GitHub Action to template and deploy Helmless Helm charts to Google Cloud Run in a single step. This streamlined action follows a "golden path" approach for ease of use, while providing just enough flexibility for common use cases.

For advanced customization, you can use the individual actions directly: helmless/template-action and helmless/google-cloudrun-action/deploy.

Prerequisites

  • A Google Cloud Platform account with appropriate permissions
  • Credentials for Google Cloud (typically provided via google-github-actions/auth)
  • Your values file must include the project and region settings to identify the GCP project and region

Example Workflow

The following example workflow demonstrates how to deploy a Helmless Helm chart to Google Cloud Run. For more details on how to setup your workflow, see the Helmless Documentation.

name: πŸš€ Deploy to Google Cloud Run

on:
  workflow_dispatch:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  deploy:
    name: πŸš€ Deploy
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - name: πŸ“₯ Checkout Repository
        uses: actions/checkout@v4

      - name: πŸ”‘ Google Auth
        id: auth
        uses: google-github-actions/auth@v2
        with:
          # See the Helmless Documentation for more information on how to setup a Workload Identity Provider
          # https://helmless.io/docs/cloudrun/ci-cd/#workload-identity-federation
          workload_identity_provider: "projects/YOUR_PROJECT_ID/locations/global/workloadIdentityPools/YOUR_WORKLOAD_IDENTITY_POOL/providers/github"

      - name: πŸš€ Deploy Workload with Custom Chart
        uses: helmless/[email protected]
        with:
          # Replace this with the path to your Helm chart using the Helmless Helm chart as dependency
          chart: './charts/e2e-test'
          # The values files are merged in order with the values.yaml file in the chart
          # The last file wins if there are conflicts
          files: |
            ./charts/values-only/values.dev.yaml
          # If true, the final manifest will be checked against the Cloud Run API
          # without actually deploying.
          dry_run: false
      
      - name: πŸš€ Deploy Helmless Default Chart
        uses: helmless/[email protected]
        with:
          # As a convenience you can set the type to "service" or "job"
          # and the chart will be set automatically.
          type: service
          # In this case you need to provide all values files you want to use.
          files: |
            ./charts/values-only/values.yaml
            ./charts/values-only/values.dev.yaml

Usage

- uses: helmless/[email protected]
  with:
    chart:
    # Helm chart to use for templating. Defaults to the Google Cloud Run chart.
    #
    # Required: false
    # Default: oci://ghcr.io/helmless/google-cloudrun-service

    chart_version:
    # Version of the Helm chart to use.
    #
    # Required: false
    # Default: latest

    type:
    # One of "service" or "job". The chart and type settings are mutually exclusive. If the type is set, the chart input will be ignored and the type will be used to determine which Helmless chart to use.
    #
    # Required: false
    # Default: ""

    files:
    # Glob patterns of value files to include when templating the chart.
    #
    # Required: false
    # Default: values.yaml

    template_only:
    # If true, only template the chart without deploying. Will also skip dry_run validation.
    #
    # Required: false
    # Default: false

    dry_run:
    # If true, only validate the configuration without deploying.
    #
    # Required: false
    # Default: false

Inputs

name description required default
chart

Helm chart to use for templating. Defaults to the Google Cloud Run chart.

false oci://ghcr.io/helmless/google-cloudrun-service
chart_version

Version of the Helm chart to use.

false latest
type

One of "service" or "job". The chart and type settings are mutually exclusive. If the type is set, the chart input will be ignored and the type will be used to determine which Helmless chart to use.

false ""
files

Glob patterns of value files to include when templating the chart.

false values.yaml
template_only

If true, only template the chart without deploying. Will also skip dry_run validation.

false false
dry_run

If true, only validate the configuration without deploying.

false false

Outputs

name description
manifests_deployed

The number of manifests that were deployed.

workloads

JSON array of all deployed Cloud Run workloads with their details (name, type, region, project).

Using Deployment Outputs

The action returns information about all deployed workloads as a JSON array, which you can use in subsequent steps:

- name: Deploy to Cloud Run
  id: deploy
  uses: helmless/[email protected]
  with:
    files: values/production.yaml

- name: Use deployment outputs
  run: |
    # The number of manifests deployed
    echo "Deployed ${{ steps.deploy.outputs.manifests_deployed }} workload(s)"
    
    # Access the workloads array (parse with jq)
    echo '${{ steps.deploy.outputs.workloads }}' | jq -r '.[] | "Deployed \(.type) \(.name) to \(.project) in \(.region)"'

🀝🏻 Contributing

We welcome contributions! Please see the Contributing Guide for more information and the general Helmless contribution guidelines.

πŸ“ License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Github Action to deploy a rendered Helmless chart to Google Cloud Run.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages