Pipery ArgoCD CD#

Reusable GitHub Action for ArgoCD deployment with structured logging via Pipery.

GitHub Marketplace Version License: MIT

Table of Contents#

Quick Start#

name: Deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pipery-dev/argocd-cd@v1.1.0
        with:
          argocd_server: argocd.example.com
          argocd_app: my-app
          image_tag: ${{ github.sha }}
          argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Pipeline Overview#

StepDescriptionSkip Input
UpdateUpdate image tag in manifestsskip_update
SyncArgoCD sync applicationskip_sync
Status checkWait for application rolloutskip_status_check

Configuration Options#

NameDefaultDescription
project_path.Path to the project source tree.
config_file.pipery/config.yamlPath to Pipery config file.
argocd_server``ArgoCD server URL (e.g., argocd.example.com).
argocd_app``ArgoCD application name.
argocd_token``ArgoCD authentication token.
image_name``Container image name to update in ArgoCD.
image_tag${{ github.sha }}Container image tag to deploy.
sync_timeout300Seconds to wait for ArgoCD sync.
prunefalsePrune resources during sync.
forcefalseForce sync even if app is in sync.
log_filepipery.jsonlPath to write the JSONL log file.
skip_updatefalseSkip image tag update step.
skip_syncfalseSkip ArgoCD sync step.
skip_status_checkfalseSkip rollout status check.

Usage Examples#

Example 1: Basic ArgoCD deployment#

name: Deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pipery-dev/argocd-cd@v1.1.0
        with:
          argocd_server: ${{ vars.ARGOCD_SERVER }}
          argocd_app: my-app
          image_tag: ${{ github.sha }}
          argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Example 2: With image name update#

- uses: pipery-dev/argocd-cd@v1.1.0
  with:
    argocd_server: argocd.example.com
    argocd_app: my-app
    image_name: my-app
    image_tag: ${{ github.sha }}
    argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Example 3: Force sync with resource pruning#

- uses: pipery-dev/argocd-cd@v1.1.0
  with:
    argocd_server: argocd.example.com
    argocd_app: my-app
    image_tag: ${{ github.sha }}
    force: true
    prune: true
    argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Example 4: Extended sync timeout#

- uses: pipery-dev/argocd-cd@v1.1.0
  with:
    argocd_server: argocd.example.com
    argocd_app: my-app
    image_tag: ${{ github.sha }}
    sync_timeout: "600"
    argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Example 5: Skip status checks for faster deployment#

- uses: pipery-dev/argocd-cd@v1.1.0
  with:
    argocd_server: argocd.example.com
    argocd_app: my-app
    image_tag: ${{ github.sha }}
    skip_status_check: true
    argocd_token: ${{ secrets.ARGOCD_TOKEN }}

Example 6: Production deployment with release tag#

- uses: pipery-dev/argocd-cd@v1.1.0
  with:
    argocd_server: argocd.example.com
    argocd_app: my-app-prod
    image_name: my-app
    image_tag: v${{ github.ref_name }}
    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/argocd-cd
    ref: v1.1.0
    file: /.gitlab-ci.yml

GitLab CI Variables#

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

  • ARGOCD_TOKEN - ArgoCD authentication token
  • ARGOCD_SERVER - ArgoCD server URL (e.g., argocd.example.com)
  • ARGOCD_APP - ArgoCD application name

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/argocd-cd:v1.1.0
    pipery-custom: pipery-dev/argocd-cd:v1.1.0:.bitbucket/shared-pipelines.yml

pipelines:
  branches:
    main:
      import: pipery-argocd-cd@pipery-shared

  custom:
    run-pipery:
      import: pipery-argocd-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:
    • ARGOCD_TOKEN - ArgoCD authentication token
    • ARGOCD_SERVER - ArgoCD server URL
    • ARGOCD_APP - ArgoCD application name
  2. Commit to trigger deployment

Pipeline Stages#

The Bitbucket equivalent follows the same structure:

checkout → setup → update → sync → status_check → logs

Features#

  • Manifest image tag updates
  • ArgoCD application sync
  • Automatic rollout monitoring
  • Resource pruning support
  • Custom sync timeouts
  • Health checks
  • 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