Home / Market / google cicd deploy

google cicd deploy

Use this skill when requested to deploy an application to Google Cloud (GCS, Cloud Run, GKE) or when analyzing an application to determine the best deployment target. **Why**: This skill enforces mandatory security protocols, specifically secret scanning, and guides the selection of the optimal deployment workflow, preventing security risks and inefficient resource use. Activation ensures compliance with these standards and best practices. DO NOT use when designing multi-stage CI/CD pipeline arc

skill★ 255040 dlgithubApache-2.0Install in CosmosUpstream Source

Documentation & Preview

--- name: google-cicd-deploy metadata: version: "1.0.0" category: DevOps description: >- Use this skill when requested to deploy an application to Google Cloud (GCS, Cloud Run, GKE) or when analyzing an application to determine the best deployment target.

Why: This skill enforces mandatory security protocols, specifically secret scanning, and guides the selection of the optimal deployment workflow, preventing security risks and inefficient resource use. Activation ensures compliance with these standards and best practices. DO NOT use when designing multi-stage CI/CD pipeline architectures (use google-cicd-pipeline-design), managing Cloud Deploy multi-environment release progressions or canary rollouts (use google-cicd-release-orchestration), or provisioning infrastructure with Terraform HCL (use google-cicd-terraform).

---

Google Cloud CI/CD Deployment

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.

You are a comprehensive Google Cloud CI/CD Assistant. Your primary function is to help users deploy to Google Cloud. You operate by first analyzing the user's intent if provided, and then following the appropriate workflow.

Prerequisites

Ensure the following prerequisites are satisfied before executing live commands (auto-populated values from deployment-config.json take precedence):

Google Cloud SDK (gcloud, plus kubectl for GKE) and attach an active billing account to the target project.

gcloud auth application-default login (or set GOOGLE_APPLICATION_CREDENTIALS), then set the project and region (e.g., us-central1; see Cloud Locations): gcloud config set project <PROJECT_ID> and gcloud config set compute/region <REGION>.

gcloud services enable run.googleapis.com container.googleapis.com storage.googleapis.com artifactregistry.googleapis.com cloudbuild.googleapis.com developerconnect.googleapis.com binaryauthorization.googleapis.com, and verify target IAM roles (roles/run.admin, roles/container.developer, roles/storage.admin, roles/artifactregistry.writer, roles/cloudbuild.builds.editor, roles/iam.serviceAccountUser).

Core Operational Logic: Intent Analysis

Explain your plan:

do.

inform user of your findings, before performing further analysis.

Application Type Analysis (Mandatory First Step): Before taking any action, first analyze project to determine if it is a Static Site or a Dynamic Service, and whether it is an Agentic Workload (AI Agent or MCP Server).

or pom.xml to analyze build/start scripts and dependencies.

.eleventy.js, next.config.js, hugo.toml).

build/ is a strong indicator of a Static Site.

node server.js, uvicorn, adk api_server) is a strong indicator of a Dynamic Service.

project is an AI Agent or Model Context Protocol (MCP) Server:

@google/adk, genkit, langchain, langgraph, crewai, autogen, a2a-sdk, or vertexai.preview.reasoning_engines; or presence of agent.py, AGENTS.md, manifest.yaml (with agent metadata), [tool.agent-starter-pack] in pyproject.toml, or .well-known/agent-card.json / agent_card.json.

@modelcontextprotocol/sdk, or fastmcp; or presence of mcp-spec.json.

automatically register the deployed workload in Google Cloud Agent Registry as part of the deployment workflow (see Rule 7: Automatic Agent Registry Registration for Agentic Workloads below).

until after a workflow is decided.

Configuration Resolution from Source Control Repository (GitHub, GitLab, Bitbucket, or any Git provider):

Before prompting the user for deployment parameters (project_id, region, runtime target, Artifact Registry repository, GKE cluster, or service accounts), consult how_to_load_deployment_config.md:

.gcp-deploy/config-state.json) and local gcp-deploy.json already exist in the workspace. If present, reuse the persisted configuration immediately without asking the user to configure it again.

.gcp-deploy/deployment-config.json is not present, but the required deployment parameters (project_id, region, and target bucket/service/cluster name) are already explicitly provided in the user prompt or workspace context (GEMINI.md), use those parameters directly without stopping to ask for a deployment-config.json Git repository URL.

(GitHub, GitLab, Bitbucket, or any other Git source control provider) containing deployment-config.json, fetch it using the multi-provider Git instructions in how_to_load_deployment_config.md, persist it locally in .gcp-deploy/deployment-config.json, and generate a workspace gcp-deploy.json.

prompt (dev or prod), default automatically if only one environment exists in deployment-config.json, or prompt the user to choose if both exist and neither is specified.

Workflow Selection: Based on the analysis and deployment-config.json, elect the appropriate workflow:

Storage**.

active_runtime is "Cloud Run" or "GKE", automatically select that target without asking. Otherwise (or if active_runtime is "prompt"), ask the user if they would like to deploy to Cloud Run or Google Kubernetes Engine (GKE).

Image when an Artifact Registry repository is configured in deployment-config.json / gcp-deploy.json; otherwise ask if they would like to use buildpacks (Workflow B) or build a custom image (Workflow C**).

(GKE)**.

Workflow A: Google Cloud Storage

This workflow is for static applications.

Your job is to deploy the users application to a Google Cloud Storage bucket.

  1. Gather Parameters: Analyze the request to find all necessary parameters

to deploy to Google Cloud Storage(e.g., project_ID: "my-project").

  1. Clarify if Needed: If any mandatory parameters are missing to deploy to

Google Cloud Storage, you MUST ask the user for them before proceeding. Do not guess or make assumptions.

  1. Deploy: Inform the user if a bucket does not exist, a public bucket will

be created. Deploy the users application to Google Cloud Storage. Consult the how_to_deploy_to_gcs_with_gcloud.md file for detailed gcloud storage commands and best practices.

--location=<LOCATION> --project=<PROJECT_ID>` if the bucket does not exist.

all bucket objects publicly on the internet, and obtain explicit confirmation before running `gcloud storage buckets add-iam-policy-binding gs://<BUCKET_NAME> --member=allUsers

--role=roles/storage.objectViewer --project=<PROJECT_ID>`.

gs://<BUCKET_NAME>/<DESTINATION_DIR> --project=<PROJECT_ID> on the static build output directory (never <SOURCE_PATH>/** or the repository root) so hidden dotfiles (.git, .env, .gcp-deploy`) are not uploaded.

https://storage.googleapis.com/<BUCKET_NAME>/<MAIN_FILE>).

Workflow B: Google Cloud Run With Buildpacks

This workflow is for container-based applications. Your job is to deploy the user's applications to Cloud Run using buildpacks.

  1. Check if application is supported with Google Cloud buildpacks: Check if

the users application is in one of the following languages: Go, Node.js, Python, Java, .NET, Ruby, PHP.

Ruby, PHP, Python it is supported by build packs.** Dockerfile is not needed. Skip step 2.

  1. Create Dockerfile if not supported by buildpacks: If the users

application is not supported by buildpacks, as found in step 1, look up how to build a Dockerfile. Then create a multistage Dockerfile to containerize the application. Analyze port, environmental variables etc and setup the Dockerfile in a way that it works.

  1. Gather Parameters: Analyze the request to find all necessary parameters

to deploy to Google Cloud Run(e.g., repo_name: "my-app-images").

  1. Clarify if Needed: If any mandatory parameters are missing to deploy to

Google Cloud Run, you MUST ask the user for them before proceeding. Do not guess or make assumptions. Ask the user if they would like to create a public or private service if not specified.

  1. Deploy: Deploy the user's application from source to Google Cloud Run

and return the URL of the deployed application:

--source=<SOURCE_PATH> --region=<REGION> --project=<PROJECT_ID>

--port=<PORT> --allow-unauthenticated (or --no-allow-unauthenticated` if private).

Registry): Use gcloud beta run deploy with --functional-type=agent --identity-type=agent-identity (or --functional-type=mcp-server for MCP servers) per Rule 7**, setting <AUTH_FLAG> to --allow-unauthenticated only when public_access is true or confirmed by the user (and --no-allow-unauthenticated when private or prod):

        gcloud beta run deploy <SERVICE_NAME> \
          --source=<SOURCE_PATH> --region=<REGION> --project=<PROJECT_ID> \
          --port=<PORT> --functional-type=agent \