Pipery Cloud Run CD#
- Repository:
pipery-cloudrun-cd - Release tag:
v1.1.0 - Catalog: /catalog/
Reusable GitHub Action for Google Cloud Run deployment with structured logging via Pipery.
Table of Contents#
- Quick Start
- Pipeline Overview
- Configuration Options
- Usage Examples
- GitLab CI
- Bitbucket Pipelines
- About Pipery
- Development
Quick Start#
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-central1
project_id: my-projectPipeline Overview#
| Step | Description | Skip Input |
|---|---|---|
| Push | Push Docker image to Artifact Registry | skip_push |
| Deploy | Deploy to Cloud Run service | skip_deploy |
| Status check | Verify service health | skip_status_check |
Configuration Options#
| Name | Default | Description |
|---|---|---|
project_path | . | Path to the project source tree. |
config_file | .pipery/config.yaml | Path to Pipery config file. |
image_name | `` | Container image name to deploy (e.g., ghcr.io/org/app). |
image_tag | ${{ github.sha }} | Container image tag to deploy. |
service_name | `` | Cloud Run service name. |
region | us-central1 | Google Cloud Run region. |
project_id | `` | Google Cloud project ID. |
platform | managed | Target platform: managed or gke. |
traffic | 100 | Percentage of traffic to route to new revision (0-100). |
min_instances | 0 | Minimum number of Cloud Run instances. |
max_instances | 100 | Maximum number of Cloud Run instances. |
concurrency | 80 | Maximum concurrent requests per instance. |
log_file | pipery.jsonl | Path to write the JSONL log file. |
skip_push | false | Skip image push step. |
skip_deploy | false | Skip deploy step. |
skip_status_check | false | Skip health check step. |
Usage Examples#
Example 1: Basic Cloud Run deployment#
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-central1
project_id: my-projectExample 2: With custom scaling and concurrency#
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-central1
project_id: my-project
min_instances: "2"
max_instances: "50"
concurrency: "100"Example 3: Blue-green deployment with gradual traffic shift#
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-west1
project_id: my-project
traffic: "50"Example 4: Multiple regions deployment#
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service-us
region: us-central1
project_id: my-project
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service-eu
region: europe-west1
project_id: my-projectExample 5: GKE-hosted Cloud Run#
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-central1
project_id: my-project
platform: gkeExample 6: Skip health checks for faster deployment#
- uses: pipery-dev/cloudrun-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
service_name: my-service
region: us-central1
project_id: my-project
skip_status_check: trueGitLab CI#
Use the GitLab mirror template when .gitlab-ci.yml is published for this pipeline family. Import it from the mirrored GitLab project or use it as a reference implementation for running the same Pipery pipeline outside GitHub Actions.
The GitLab pipeline maps action inputs to CI/CD variables, publishes pipery.jsonl as an artifact, and maintains the same skip controls. Store credentials as protected GitLab CI/CD variables.
include:
- project: pipery-dev/cloudrun-cd
ref: v1.1.0
file: /.gitlab-ci.ymlGitLab CI Variables#
Configure these protected variables in Settings > CI/CD > Variables:
GCLOUD_SERVICE_KEY_BASE64- GCP service account key (base64-encoded)GCP_PROJECT_ID- Google Cloud project IDCLOUDRUN_SERVICE- Cloud Run service nameCLOUDRUN_REGION- Deployment region (default: us-central1)
Bitbucket Pipelines#
Bitbucket Cloud pipelines provide an alternative to GitHub Actions. Use Bitbucket shared pipeline imports to reference the exported Pipery pipeline instead of copying YAML into every application repository.
Getting Started#
- Add a Bitbucket import source for the shared Pipery pipeline and import the exported pipeline by name:
definitions:
imports:
pipery-shared: pipery-dev/cloudrun-cd:v1.1.0
pipery-custom: pipery-dev/cloudrun-cd:v1.1.0:.bitbucket/shared-pipelines.yml
pipelines:
branches:
main:
import: pipery-cloudrun-cd@pipery-shared
custom:
run-pipery:
import: pipery-cloudrun-cd@pipery-customUse {project-path}/{repo-slug}:{branch-or-tag} for a shared repository bitbucket-pipelines.yml, or {project-path}/{repo-slug}:{branch-or-tag}:{config-filepath} for another exported YAML file.
- Configure Protected Variables in Repository Settings > Pipelines > Repository Variables:
GCLOUD_SERVICE_KEY_BASE64- GCP service account keyGCP_PROJECT_ID- Google Cloud project IDCLOUDRUN_SERVICE- Cloud Run service nameCLOUDRUN_REGION- Deployment region
- Commit to trigger deployment
Pipeline Stages#
The Bitbucket equivalent follows the same structure:
checkout → setup → push → deploy → status_check → logs
Features#
- Artifact Registry image push
- Managed and GKE Cloud Run support
- Automatic traffic shifting
- Instance and concurrency scaling
- Health checks and monitoring
- Multi-region deployments
- JSONL-based pipeline logging
- 90-day log retention
About Pipery#
Pipery is an open-source CI/CD observability platform. Every step script runs under psh (Pipery Shell), which intercepts all commands and emits structured JSONL events — giving you full visibility into your pipeline without any manual instrumentation.
- Browse logs in the Pipery Dashboard
- Find all Pipery actions on GitHub Marketplace
- Source code: pipery-dev
Development#
# Run the action locally against test-project/
pipery-actions test --repo .
# Regenerate docs
pipery-actions docs --repo .
# Dry-run release
pipery-actions release --repo . --dry-run