Skip to content

GitHub Actions integration

We provided a GitHub composite action called kpops-runner that installs all the necessary dependencies and runs KPOps commands with the given parameters.

Input Parameters

Name Required Default Value Type Description
command - string KPOps command to run. generate, deploy, destroy, reset, clean are possible values. Flags such as --dry-run and --execute need to be specified
pipeline - string Pipeline to run by KPOps
working-directory . string root directory used by KPOps to run pipelines
pipeline-base-dir - string directory where relative pipeline variables are initialized from
defaults - string defaults folder path
config - string config.yaml file path
components - string components package path
filter-type - string Whether to include/exclude the steps defined in KPOPS_PIPELINE_STEPS
python-version "3.11.x" string Python version to install (Defaults to the latest stable version of Python 3.11)
kpops-version latest string KPOps version to install
helm-version latest string Helm version to install
token latest string secrets.GITHUB_TOKEN, needed for setup-helm action if helm-version is set to latest

Usage

steps:
  # ...
  # This step is useful for debugging reasons
  - name: Generate Kafka pipeline
    uses: bakdata/kpops/actions/kpops-runner@main
    with:
      command: generate
      working-directory: home/my-kpops-root-dir
      pipeline: pipelines/my-pipeline-file.yaml
      kpops-version: 1.2.3

  - name: Deploy Kafka pipeline
    uses: bakdata/kpops/actions/kpops-runner@main
    with:
      command: deploy --execute
      working-directory: home/my-kpops-root-dir
      pipeline: pipelines/my-pipeline-file.yaml
      kpops-version: 1.2.3
  # ...

It is possible to execute the KPOps runner on a dev version from the test.pypi.

1
2
3
4
5
6
7
8
steps:
  - name: Deploy Kafka pipeline
    uses: bakdata/kpops/actions/kpops-runner@main
    with:
      command: deploy --execute
      working-directory: home/my-kpops-root-dir
      pipeline: pipelines/my-pipeline-file.yaml
      kpops-version: 1.2.5.dev20230707132709 -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/