{"id":19207131,"url":"https://github.com/kestra-io/deploy-action","last_synced_at":"2025-05-12T17:47:28.613Z","repository":{"id":103404722,"uuid":"596101307","full_name":"kestra-io/deploy-action","owner":"kestra-io","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T12:58:40.000Z","size":28,"stargazers_count":8,"open_issues_count":1,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-20T15:44:04.914Z","etag":null,"topics":["github-actions","kestra"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kestra-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-01T13:22:28.000Z","updated_at":"2024-11-12T07:28:06.000Z","dependencies_parsed_at":"2024-01-29T20:12:51.481Z","dependency_job_id":"a926fd0c-b2ea-4c9b-b1d9-7f73398ae298","html_url":"https://github.com/kestra-io/deploy-action","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kestra-io%2Fdeploy-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kestra-io%2Fdeploy-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kestra-io%2Fdeploy-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kestra-io%2Fdeploy-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kestra-io","download_url":"https://codeload.github.com/kestra-io/deploy-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253789967,"owners_count":21964777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","kestra"],"created_at":"2024-11-09T13:18:25.906Z","updated_at":"2025-05-12T17:47:26.273Z","avatar_url":"https://github.com/kestra-io.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy Action\n\nOfficial GitHub Action to create a CI/CD pipeline that deploys [Flows](https://kestra.io/docs/workflow-components/flow) or [Namespace Files](https://kestra.io/docs/concepts/namespace-files) to your Kestra server.\n\nThis action should be used within a workflow that runs only on your `main` branch.\n\n## Important notes❗️\n\nOnly **one namespace** can be specified in each \u003ccode\u003eKestra Deploy Action\u003c/code\u003e so you may need to\nreuse the action for each namespace. Here is an example:\n\n```yaml\n      - name: deploy-prod\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: prod\n          directory: ./flows\n      - name: deploy-prod-marketing\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: prod.marketing\n          directory: ./flows/marketing\n```\n\nAlso, note that this GitHub Action supports flows built with Kestra v0.6.1+.\n\n## What does the action do?\n\nIt takes a `directory` as an input argument, indicating the directory within your repository where your `Flow` or `Template` YAML files are stored.\n\nFor each resource, the following outcomes are possible:\n  * **Create** a flow or a template resource, if the resource does not exist.\n  * **Update** a flow or a template resource, if the resource exists.\n  * **Delete** a flow or a template resource, if the resource exists, but the file does not exist anymore (i.e. the flow or template file got deleted).\n      * You can disable the deletion of a given resource by setting `delete: false` in the action, as shown in the full example below.\n\nThe action logs all these outcomes by specifying which resources got updated, added or deleted.\n\n## Usage\n\nNote that the action can NOT update multiple namespaces at the same time. We recommend grouping your `Flows` and\n`Templates` into subdirectories indicating a specific namespace. For the example shown above, your directory structure could look as follows:\n```bash\n.\n├── flows\n│   ├── flow1.yml\n│   ├── flow2.yml\n│   └── flow3.yml\n├── marketing\n│   ├── marketing__flow1.yml\n│   ├── marketing__flow2.yml\n│   └── marketing__flow3.yml\n```\n\nAlso, you should always deploy your `Templates` before your `Flows`, to avoid running before their\ntemplates are created.\n\nNamespace files should also be deployed before the flows to prevent a flow depending on one of these files before the file exists.\n\n## `.kestraignore` file\nNote that when using the `namespace_files` resource type, you can add a special file called `.kestraignore` to ignore some files and folders using regular expression patterns that follow the [.gitignore](https://git-scm.com/docs/gitignore) syntax.\n\n### Example\nExample of a `.kestraignore` file (which works exactly the same way as `.gitignore`):\n\n```gitignore\nflows/\nDockerfile\ndocker-compose.yml\n*.md\n```\n\n\n### Inputs\n\n| Inputs        | Required           | Default | Description                                                                                                                                                         |\n|---------------|--------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``namespace`` | :heavy_check_mark: |         | Namespace containing your flows and templates                                                                                                                       |\n| ``directory`` | :heavy_check_mark: |         | Folder containing your resources                                                                                                                                    |\n| ``resource``  | :heavy_check_mark: |         | Resource you want to update in your namespace, can be either `flow`,`template` or `namespace_files`                                                      |\n| ``server``    | :heavy_check_mark: |         | URL of your Kestra server                                                                                                                                           |\n| ``user``      | :x:                |         | User name of your Kestra server                                                                                                                                     |\n| ``password``  | :x:                |         | Password of your Kestra server                                                                                                                                      |\n| ``delete``    | :x:                | 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 |\n| ``tenant``    | :x:                |         | Tenant identifier (EE only, when multi-tenancy is enabled)                                                                                                          |\n| ``to``    | :x:                |         | Remote path indicating where to upload namespace files to                                                                                                          |\n\n\n### Auth\n\nDepending on your Kestra edition, you may need to include a `user` and `password` to authenticate the action with your Kestra server.\n\n### Example\n\nExample with `Flows` resources:\n\n```yaml\n      - name: flow update namespace action\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: io.kestra.namespace\n          resource: flow\n          directory: ./flows/namespace_dedicated_folder\n          server: https:/kestra.io\n```\n\nExample with `namespace_file` resources:\n\n```yaml\n      - name: template update namespace action\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: io.kestra.namespace\n          resource: namespace_file\n          directory: ./files/namespace_dedicated_folder\n          server: https:/kestra.io\n```\n\nExample with `Templates` resources (deprecated):\n\n```yaml\n      - name: template update namespace action\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: io.kestra.namespace\n          resource: template\n          directory: ./templates/namespace_dedicated_folder\n          server: https:/kestra.io\n```\n\n\n## Full Example\n\nAssuming that you store all your flow YAML files in the `flows` directory and that all flows belong to the namespace `prod`, you can configure a GitHub Action workflow by creating the following file (you can store the file as `.github/workflows/main.yml`):   \n\n```yaml\nname: Kestra CI/CD\non: \n  workflow_dispatch:\njobs:\n  kestra:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - name: deploy\n        uses: kestra-io/deploy-action@master\n        with:\n          namespace: prod\n          directory: ./flows\n          resource: flow\n          server: ${{secrets.KESTRA_HOST}}\n          user: ${{secrets.KESTRA_USER}}\n          password: ${{secrets.KESTRA_PASSWORD}}\n          delete: false\n```\n\nThis setup also assumes that you stored the host name, user name and password as Actions secrets. \n\nFinally, instead of only running this workflow manually, you can configure it to be triggered upon push to the main branch:\n\n```yaml\nname: Kestra CI/CD\non:\n  push:\n    branches:\n      - main\njobs:\n  ...\n```\n\nRead more in the documentation [here](https://kestra.io/docs/version-control-cicd/cicd/github-action).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkestra-io%2Fdeploy-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkestra-io%2Fdeploy-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkestra-io%2Fdeploy-action/lists"}