Pipery Docker CD#

Reusable GitHub Action for Docker CD — pull image, deploy, and verify — with structured logging via Pipery.

GitHub Marketplace Version License: MIT

Table of Contents#

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#

StepDescriptionSkip Input
DownloadPull Docker image from registryskip_download
DeployDeploy via ArgoCD, Cloud Run, Helm, or Ansibleskip_deploy
Status checkVerify deployment healthskip_status_check

Configuration Options#

NameDefaultDescription
image_name``Docker image to pull (e.g., ghcr.io/org/app).
image_taglatestImage tag to pull.
registryghcr.ioContainer 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.yamlPath to Pipery config file.
deploy_targetargocdDeployment target: argocd, cloud-run, helm, or ansible.
deploy_strategyrollingDeployment 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_regionus-central1Cloud 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_namespacedefaultKubernetes namespace.
ansible_playbook``Path to Ansible playbook.
ansible_inventory``Path to Ansible inventory.
log_filepipery.jsonlPath to the JSONL structured log file.
skip_downloadfalseSkip the download step.
skip_deployfalseSkip the deploy step.
skip_status_checkfalseSkip 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/service

Helm#

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: production

Ansible#

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/production

Usage 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-west1

Example 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: production

Example 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.yml

Example 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.yml

GitLab CI Variables#

Configure these protected variables in Settings > CI/CD > Variables:

  • REGISTRY_PASSWORD - Container registry authentication
  • ARGOCD_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#

  1. 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-custom

Use {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.

  1. Configure Protected Variables in Repository Settings > Pipelines > Repository Variables:
    • REGISTRY_PASSWORD - Container registry password
    • ARGOCD_TOKEN - ArgoCD token (if using ArgoCD)
    • GCLOUD_SERVICE_KEY_BASE64 - GCP service account key (if using Cloud Run)
  2. Set DEPLOY_TARGET variable (e.g., “argocd”, “cloud-run”, “helm”, “ansible”)
  3. 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 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.

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