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.
- Kestra Validate Action - Validate your flows and templates before deploying anything.
- Kestra Deploy Action - Deploy your flows and templates to your Kestra server.
Input Reference
Validate Inputs
Inputs | Required | Default | Description |
---|---|---|---|
directory | ✔️ | Folder containing your resources | |
resource | ✔️ | Resource you want to update in your namespace, can be flow or template | |
server | ❌ | URL of your Kestra server, if none is provided, validation is done locally | |
user | ❌ | User for the basic auth | |
password | ❌ | Password for the basic auth | |
apiToken | ❌ | API token for EE auth | |
tenant | ❌ | Tenant identifier (EE only, when multi-tenancy is enabled) |
Deploy Inputs
Inputs | Required | Default | Description |
---|---|---|---|
namespace | ✔️ | Namespace containing your flows and templates | |
directory | ✔️ | Folder containing your resources | |
resource | ✔️ | Resource you want to update in your namespace, can be either flow ,template or namespace_files | |
server | ✔️ | URL of your Kestra server | |
user | ❌ | User name of your Kestra server | |
password | ❌ | Password of your Kestra server | |
delete | ❌ | true | Flows 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 | ❌ | Tenant identifier (EE only, when multi-tenancy is enabled) | |
to | ❌ | 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.
Was this page helpful?