We provide two official GitHub Actions to help you create a CI/CD pipeline for your Kestra flows.

Such a CI/CD pipeline is called a Workflow, and is built with Actions performing validation and deployment of your flows.

To use the GitHub Actions, your Kestra installation must be accessible from the GitHub Actions runner. This means that your Kestra server must be accessible from the internet, or that you must use a self-hosted runner.

Kestra Actions

Kestra offers two Actions to create a CI/CD pipeline within a GitHub repository.

Examples

Here is an example of a Workflow using the Kestra actions to validate all Flows before deploying them.

yaml
name: Kestra CI/CD
on: [push]
jobs:
  validate:
    runs-on: ubuntu-latest
    name: Kestra validate
    steps:
      - name: Validate all flows on server-side
        uses: actions/kestra-validate-action@develop
        with:
          directory: ./kestra/flows
          server: https://kestra.io/
          apiToken: ${{ secrets.KESTRA_API_TOKEN }}

  # If validation passed, deploy resources
  deploy:
    runs-on: ubuntu-latest
    name: Kestra deploy
    steps:
      # We can only deploy to one namespace at once,
      # so we have two different steps for our two namespaces product and engineering
      - name: Deploy product flows
        uses: actions/kestra-deploy-action@develop
        with:
          namespace: product
          directory: ./kestra/flows/product
          server: https://kestra.io/
          apiToken: ${{ secrets.KESTRA_API_TOKEN }}

      - name: Deploy engineering flows
        uses: actions/kestra-deploy-action@develop
        with:
          namespace: engineering
          directory: ./kestra/flows/engineering
          server: https://kestra.io/
          apiToken: ${{ secrets.KESTRA_API_TOKEN }}

Was this page helpful?