> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/step-library/google-cloud-functions-deploy.md).

# Google Cloud Functions Deploy

Create or update a Google Cloud Function from a manifest and artifact source.

The deploy step creates or updates a Google Cloud Function (Gen 2) using the service's manifest and artifact source. It captures the function's pre-deployment state as rollback data, and makes the function name, revision, and first-deployment flag available to later steps as output variables.

***

### Deploy YAML <a href="#deploy-yaml" id="deploy-yaml"></a>

Minimal form:

```yaml
- name: Google Cloud Function Deploy
  id: googleCloudFunctionDeployStep
  template:
    uses: googleCloudFunctionDeployStep
```

With explicit overrides:

```yaml
- name: Google Cloud Function Deploy
  id: googleCloudFunctionDeployStep
  template:
    uses: googleCloudFunctionDeployStep
    with:
      skip_traffic: true
      command_timeout: 15m
      log_level: debug
```

***

### How the deploy step works <a href="#how-the-deploy-step-works" id="how-the-deploy-step-works"></a>

When the step runs, Harness executes the following actions in order:

1. Authenticates with Google Cloud using the connector configured on the infrastructure definition.
2. Renders the Cloud Function manifest at **Cloud Function Manifest Path** and resolves the artifact source.
3. Creates or updates the Google Cloud Function (Gen 2), which deploys the function as a backing Cloud Run service.
4. Unless **Skip Traffic** is `true`, routes traffic to the new revision as part of the update.
5. Saves the function name, revision, and first-deployment flag to step output, and saves the function's pre-deployment traffic state as rollback data for the rollback step.

***

### Deploy fields <a href="#deploy-fields" id="deploy-fields"></a>

The following fields configure what the deploy step deploys and how it authenticates to Google Cloud.

| Field                            | Default                     | Description                                                                                                                                                                       |
| -------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Cloud Function Manifest Path** | `${{runtime.manifestPath}}` | Path to the rendered Cloud Function manifest file in the workspace. Auto-resolved from the service's manifest.                                                                    |
| **Artifact Source**              | —                           | The `gs://` URL of the function source archive, for example `gs://my-bucket/my-function-source.zip`. Auto-resolved from the service's artifact source.                            |
| **Update Field Mask**            | —                           | A comma-separated list of top-level fields to update on the Cloud Function resource, for example `buildConfig,serviceConfig`. Matches the Google Cloud API update mask parameter. |
| **GCP Connector**                | —                           | The Google Cloud connector used to authenticate and deploy. Required.                                                                                                             |
| **GCP Region**                   | `${{infra.region}}`         | The Google Cloud region where the function deploys. Auto-resolved from the infrastructure definition.                                                                             |
| **GCP Project**                  | `${{infra.project}}`        | The Google Cloud project where the function deploys. Auto-resolved from the infrastructure definition.                                                                            |
| **Skip Traffic**                 | `false`                     | When `true`, the deployed revision does not receive traffic until a separate traffic shift step runs.                                                                             |
| **Command Timeout**              | `10m`                       | Maximum time for the step to complete.                                                                                                                                            |
| **Log Level**                    | `info`                      | Log verbosity for the step execution.                                                                                                                                             |

{% hint style="info" %}
**Advanced section**

The step template also has a collapsible **Advanced** section for additional overrides not covered above.
{% endhint %}

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Google Cloud Functions step library](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/step-library.md) for the full list of available steps.
* Go to [Basic](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-functions/google-cloud-functions-deployment-strategies/basic.md) to use this step in a managed strategy.
