Skip to main content
Automate your Kodexa metadata deployments by integrating kdx sync deploy into your CI/CD pipelines. Whether you use GitHub Actions, GitLab CI, Jenkins, or another system, the pattern is the same: install the kdx CLI, configure environment credentials, and run kdx sync deploy.
For GitHub Actions, the kdx-sync-action handles CLI installation, caching, and output parsing automatically: kodexa-ai/kdx-sync-action

GitHub Actions with kdx-sync-action

The recommended approach for GitHub Actions is the kdx-sync-action composite action, which wraps the kdx CLI with automatic binary management and deployment output parsing.

Quick Start

Deploy to Kodexa in 4 steps:

1. Define Branch and Tag Mappings

Create sync-config.yaml in your repository root:

2. Add Secrets

In GitHub repository settings, navigate to Secrets and variables then Actions, and add:
  • KODEXA_PROD_API_KEY
  • KODEXA_STAGING_API_KEY
  • KODEXA_DEV_API_KEY
Use GitHub environments to add protection rules like required approvals for production deployments.

3. Create Workflow

Create .github/workflows/deploy.yml:

4. Push and Deploy

The branch or tag determines the deployment target automatically:
  • Push to main deploys to production
  • Push to feature/new-thing deploys to dev
  • Tag v1.0.0 deploys to production

kdx-sync-action Reference

Inputs

All inputs are optional:

Outputs

Using Outputs

Workflow Examples

Pull Request Validation

Validate changes and comment on PRs before merging:

Production with Required Approval

Tag-Based Release Workflow

With tag mappings in sync-config.yaml:
Release workflow:

Scheduled Synchronization

Multi-Environment Promotion

A common pattern is promoting configurations across environments using branches:
Each branch/tag maps to a target and environment in sync-config.yaml. Merging a PR to main automatically deploys to production.
This approach gives you:
  • Feature isolation — develop and test without affecting other environments
  • Progressive rollout — changes flow through dev, staging, then production
  • Immutable releases — tags provide a fixed point for production deployments
  • Automated promotion — merging a PR triggers deployment to the target environment

Pulling Changes Back to Git

Use mode: pull to sync changes FROM a running Kodexa instance back into your git repository. This captures edits made in the platform UI and surfaces them as pull requests for team review.

Scheduled Sync

Run daily (or on any schedule) to keep git in sync with UI changes:
The action will:
  1. Pull all resources from the production environment
  2. Discover and merge any new resources into the manifest
  3. Commit changes to a sync/prod branch
  4. Open (or update) a PR for team review
This is especially useful when team members edit resources in the platform UI. The scheduled pull captures those changes and brings them back into version control automatically.

On-Demand Pull with Environment Selection

For manual pulls with a dropdown to choose the environment:

Pull Mode Inputs

Pull Mode Outputs

Pull mode requires permissions: contents: write and pull-requests: write in your workflow file. The action uses actions/checkout credentials to push and the GITHUB_TOKEN to create PRs.

JSON Reports

Generate structured deployment reports for CI dashboard integration:
The report includes timestamps, success/failure status, resource counts, and error details. Useful for:
  • Slack/Teams notifications with deployment details
  • Deployment tracking dashboards
  • Automated rollback triggers
  • Audit trails and compliance reporting
In GitHub Actions, the kdx-sync-action exposes the report via outputs:

Example: Complete GitHub Actions Workflow

A production-ready workflow combining PR validation, multi-environment deployment, Slack notifications, and artifact upload:

Other CI/CD Systems

The kdx-sync-action is GitHub-specific, but the underlying kdx CLI works in any CI/CD system. The pattern is always the same: install the binary, set environment variables for credentials, and run kdx sync deploy.

GitLab CI

Jenkins

CircleCI

For any CI/CD system, the key requirements are:
  1. Download and install the kdx CLI binary for your platform
  2. Set the appropriate KODEXA_*_API_KEY environment variables
  3. Ensure sync-config.yaml is present in the repository
  4. Run kdx sync deploy --confirm-all (the --confirm-all flag skips interactive prompts)

Next Steps

Sync Configuration

Configure sync-config.yaml targets and environments

Manifests

Define which resources to deploy with manifests

Conflict Detection

Handle conflicts when multiple sources modify resources

GitOps with GitHub Actions

Full GitHub Actions reference with migration guide and security practices