Pipery Docker CD#
- Repository:
pipery-docker-cd - Release tag:
v1.1.0 - Catalog: /catalog/
Reusable GitHub Action for Docker CD — pull image, deploy, and verify — with structured logging via Pipery.
Table of Contents#
- Quick Start
- Pipeline Overview
- Configuration Options
- Deployment Targets
- Usage Examples
- GitLab CI
- Bitbucket Pipelines
- About Pipery
- Development
Quick Start#
name: CD
on:
push:
branches: [main]
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: argocd
argocd_server: ${{ vars.ARGOCD_SERVER }}
argocd_app: my-app
argocd_token: ${{ secrets.ARGOCD_TOKEN }}Pipeline Overview#
| Step | Description | Skip Input |
|---|---|---|
| Download | Pull Docker image from registry | skip_download |
| Deploy | Deploy via ArgoCD, Cloud Run, Helm, or Ansible | skip_deploy |
| Status check | Verify deployment health | skip_status_check |
Configuration Options#
| Name | Default | Description |
|---|---|---|
image_name | `` | Docker image to pull (e.g., ghcr.io/org/app). |
image_tag | latest | Image tag to pull. |
registry | ghcr.io | Container registry hostname. |
registry_username | `` | Registry login username. |
registry_password | `` | Registry login password or token. |
project_path | . | Path to the project source tree. |
config_file | .pipery/config.yaml | Path to Pipery config file. |
deploy_target | argocd | Deployment target: argocd, cloud-run, helm, or ansible. |
deploy_strategy | rolling | Deployment strategy: rolling, blue-green, or canary. |
argocd_server | `` | ArgoCD server URL. |
argocd_app | `` | ArgoCD application name. |
argocd_token | `` | ArgoCD authentication token. |
cloud_run_service | `` | Cloud Run service name. |
cloud_run_region | us-central1 | Cloud Run region. |
cloud_run_image | `` | Container image to deploy to Cloud Run. |
helm_release | `` | Helm release name. |
helm_chart | `` | Helm chart path or reference. |
helm_namespace | default | Kubernetes namespace. |
ansible_playbook | `` | Path to Ansible playbook. |
ansible_inventory | `` | Path to Ansible inventory. |
log_file | pipery.jsonl | Path to the JSONL structured log file. |
skip_download | false | Skip the download step. |
skip_deploy | false | Skip the deploy step. |
skip_status_check | false | Skip the post-deploy status check. |
Deployment Targets#
ArgoCD#
Deploy to Kubernetes via ArgoCD. Automatically syncs and monitors the application.
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: argocd
argocd_server: argocd.example.com
argocd_app: my-app
argocd_token: ${{ secrets.ARGOCD_TOKEN }}Cloud Run#
Deploy serverless containers to Google Cloud Run.
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: cloud-run
cloud_run_service: my-service
cloud_run_region: us-central1
cloud_run_image: gcr.io/project/serviceHelm#
Deploy using Helm charts on Kubernetes clusters.
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: helm
helm_release: my-release
helm_chart: ./helm/my-chart
helm_namespace: productionAnsible#
Deploy to VMs or bare metal servers using Ansible playbooks.
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
deploy_target: ansible
ansible_playbook: deploy.yml
ansible_inventory: inventory/productionUsage Examples#
Example 1: ArgoCD deployment#
name: CD
on:
push:
branches: [main]
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: argocd
argocd_server: ${{ vars.ARGOCD_SERVER }}
argocd_app: my-app
argocd_token: ${{ secrets.ARGOCD_TOKEN }}Example 2: Cloud Run with custom region#
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: gcr.io/my-project/my-service
image_tag: ${{ github.sha }}
deploy_target: cloud-run
cloud_run_service: my-service
cloud_run_region: europe-west1Example 3: Blue-green deployment strategy#
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: argocd
deploy_strategy: blue-green
argocd_server: argocd.example.com
argocd_app: my-app
argocd_token: ${{ secrets.ARGOCD_TOKEN }}Example 4: Helm with custom values#
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: helm
helm_release: my-release
helm_chart: bitnami/my-chart
helm_namespace: productionExample 5: Ansible deployment with custom inventory#
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
deploy_target: ansible
ansible_playbook: playbooks/deploy.yml
ansible_inventory: inventories/production/hosts.ymlExample 6: Skip status checks for faster deployment#
- uses: pipery-dev/docker-cd@v1.1.0
with:
image_name: ghcr.io/${{ github.repository }}
image_tag: ${{ github.sha }}
deploy_target: argocd
argocd_server: argocd.example.com
argocd_app: my-app
skip_status_check: true
argocd_token: ${{ secrets.ARGOCD_TOKEN }}GitLab 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/docker-cd
ref: v1.1.0
file: /.gitlab-ci.ymlGitLab CI Variables#
Configure these protected variables in Settings > CI/CD > Variables:
REGISTRY_PASSWORD- Container registry authenticationARGOCD_TOKEN- ArgoCD authentication (if using ArgoCD)GCLOUD_SERVICE_KEY_BASE64- GCP service account key (if using Cloud Run)
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/docker-cd:v1.1.0
pipery-custom: pipery-dev/docker-cd:v1.1.0:.bitbucket/shared-pipelines.yml
pipelines:
branches:
main:
import: pipery-docker-cd@pipery-shared
custom:
run-pipery:
import: pipery-docker-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:
REGISTRY_PASSWORD- Container registry passwordARGOCD_TOKEN- ArgoCD token (if using ArgoCD)GCLOUD_SERVICE_KEY_BASE64- GCP service account key (if using Cloud Run)
- Set
DEPLOY_TARGETvariable (e.g., “argocd”, “cloud-run”, “helm”, “ansible”) - Commit to trigger deployment
Pipeline Stages#
The Bitbucket equivalent follows the same structure:
checkout → setup → download → deploy → status_check → logs
Additional Deployment Targets#
Support for:
- ArgoCD: Kubernetes GitOps deployments
- Cloud Run: Google Cloud Run serverless
- Helm: Kubernetes Helm charts
- Ansible: VMs and bare metal
Features#
- Multi-target Docker image deployment
- Container registry authentication
- Deployment strategies: rolling, blue-green, canary
- Health checks and rollback support
- 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