# google-github-actions/deploy-cloudrun architecture

> Architecture diagram of the GitHub repository google-github-actions/deploy-cloudrun, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google-github-actions/deploy-cloudrun
- Repository: https://github.com/google-github-actions/deploy-cloudrun

## Overview

This GitHub Action deploys a container image or source to Cloud Run and exposes the resulting service URL as an Actions output. Its main workflow reads deployment inputs, prepares gcloud and authentication, constructs a service or job deployment command, and can optionally update traffic. It parses gcloud responses into action outputs. The README also documents metadata-based deployment and configuration for environment variables, secrets, labels, and other deployment options. The source excerpt shows the main orchestration and parser calls; other documented capabilities are represented at that level without inferring their internal implementation.

Main entry points: [`src/main.ts`](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts) (Deployment orchestration), [`src/output-parser.ts`](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/output-parser.ts) (Response parsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_action["Action workflow"]
  node_orchestrator["Deployment orchestration<br/>[main.ts]"]
  node_deploy_modes["Service and job modes<br/>[main.ts]"]
  node_deploy_config["Deployment configuration<br/>[main.ts]"]
  node_sdk_auth["gcloud setup and auth<br/>[main.ts]"]
end

subgraph group_response["Response handling"]
  node_response_parser["Response parsing<br/>[output-parser.ts]"]
  node_action_outputs["GitHub Action outputs<br/>[main.ts]"]
end

subgraph group_cloud["Cloud deployment"]
  node_gcloud["gcloud CLI"]
  node_cloud_run["Cloud Run"]
end

node_workflow(("GitHub workflow"))
node_output_consumer(("Workflow output consumer"))

node_workflow -->|"provides inputs"| node_orchestrator
node_orchestrator -->|"selects mode"| node_deploy_modes
node_orchestrator -->|"builds flags"| node_deploy_config
node_orchestrator -->|"prepares CLI"| node_sdk_auth
node_sdk_auth -->|"configures"| node_gcloud
node_orchestrator -->|"executes deploy"| node_gcloud
node_gcloud -->|"deploys to"| node_cloud_run
node_orchestrator -->|"parses response"| node_response_parser
node_orchestrator -->|"updates traffic"| node_gcloud
node_response_parser -->|"returns URL"| node_action_outputs
node_action_outputs -->|"exposes URL"| node_output_consumer

click node_orchestrator "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts"
click node_deploy_modes "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts"
click node_deploy_config "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts"
click node_sdk_auth "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts"
click node_response_parser "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/output-parser.ts"
click node_action_outputs "https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_orchestrator,node_deploy_modes,node_deploy_config,node_sdk_auth toneBlue
class node_response_parser,node_action_outputs toneAmber
class node_gcloud,node_cloud_run toneMint
class node_workflow,node_output_consumer toneIndigo
```

## Components

### Action workflow

- [Deployment orchestration](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts): `src/main.ts`
- [Service and job modes](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts): `src/main.ts`
- [Deployment configuration](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts): `src/main.ts`
- [gcloud setup and auth](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts): `src/main.ts`

### Response handling

- [Response parsing](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/output-parser.ts): `src/output-parser.ts`
- [GitHub Action outputs](https://github.com/google-github-actions/deploy-cloudrun/blob/main/src/main.ts): `src/main.ts`

### Cloud deployment

- **gcloud CLI**
- **Cloud Run**

### Other components

- **GitHub workflow**
- **Workflow output consumer**

## Connections

- GitHub workflow → Deployment orchestration: provides inputs (evidence: `README.md`)
- Deployment orchestration → Service and job modes: selects mode (evidence: `src/main.ts`)
- Deployment orchestration → Deployment configuration: builds flags (evidence: `src/main.ts`)
- Deployment orchestration → gcloud setup and auth: prepares CLI (evidence: `src/main.ts`)
- gcloud setup and auth → gcloud CLI: configures (evidence: `src/main.ts`)
- Deployment orchestration → gcloud CLI: executes deploy (evidence: `src/main.ts`)
- gcloud CLI → Cloud Run: deploys to (evidence: `README.md`)
- Deployment orchestration → Response parsing: parses response (evidence: `src/main.ts`)
- Deployment orchestration → gcloud CLI: updates traffic (evidence: `src/main.ts`)
- Response parsing → GitHub Action outputs: returns URL (evidence: `src/main.ts`)
- GitHub Action outputs → Workflow output consumer: exposes URL (evidence: `README.md`)
