GitHub Actions

How to use GitHub Actions to create a CI/CD pipeline for your Kestra flows.

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


In GitHub Actions, CI/CD pipelines are 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.

Input Reference

Validate Inputs

InputsRequiredDefaultDescription
directory:heavy_check_mark:Folder containing your resources
resource:heavy_check_mark:Resource you want to update in your namespace, can be flow or template
server:x:URL of your Kestra server, if none is provided, validation is done locally
user:x:User for the basic auth
password:x:Password for the basic auth
apiToken:x:API token for EE auth
tenant:x:Tenant identifier (EE only, when multi-tenancy is enabled)

Deploy Inputs

InputsRequiredDefaultDescription
namespace:heavy_check_mark:Namespace containing your flows and templates
directory:heavy_check_mark:Folder containing your resources
resource:heavy_check_mark:Resource you want to update in your namespace, can be either flow,template or namespace_files
server:heavy_check_mark:URL of your Kestra server
user:x:User name of your Kestra server
password:x:Password of your Kestra server
delete:x:trueFlows found in Kestra server, but no longer existing in a specified directory, will be deleted by default. Set this to false if you want to avoid that behavior
tenant:x:Tenant identifier (EE only, when multi-tenancy is enabled)
to:x:Remote path indicating where to upload namespace files to

Examples

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

name: Kestra CI/CD
on: [push]
jobs:
validate:
runs-on: ubuntu-latest
name: Kestra validate
steps:
- name: Checkout repo content
uses: actions/checkout@v4
- name: Validate all flows on server-side
uses: kestra-io/validate-action@develop
with:
directory: ./kestra/flows
resource: flow
server: server_url
# 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: Checkout repo content
uses: actions/checkout@v4
- name: Deploy product flows
uses: kestra-io/deploy-action@master
with:
namespace: product
directory: ./kestra/flows/product
resource: flow
server: server_url
- name: Deploy engineering flows
uses: kestra-io/deploy-action@master
with:
namespace: engineering
directory: ./kestra/flows/engineering
resource: flow
server: server_url

Check out the How-to Guide for more examples.