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 thekdx-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
Createsync-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_KEYKODEXA_STAGING_API_KEYKODEXA_DEV_API_KEY
3. Create Workflow
Create.github/workflows/deploy.yml:
4. Push and Deploy
- Push to
maindeploys to production - Push to
feature/new-thingdeploys to dev - Tag
v1.0.0deploys 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
sync-config.yaml:
Scheduled Synchronization
Multi-Environment Promotion
A common pattern is promoting configurations across environments using branches:sync-config.yaml. Merging a PR to main automatically deploys to production.
- 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
Usemode: 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:- Pull all resources from the production environment
- Discover and merge any new resources into the manifest
- Commit changes to a
sync/prodbranch - Open (or update) a PR for team review
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:- Slack/Teams notifications with deployment details
- Deployment tracking dashboards
- Automated rollback triggers
- Audit trails and compliance reporting
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
Thekdx-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:
- Download and install the kdx CLI binary for your platform
- Set the appropriate
KODEXA_*_API_KEYenvironment variables - Ensure
sync-config.yamlis present in the repository - Run
kdx sync deploy --confirm-all(the--confirm-allflag 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
