Skip to main content
keel deploy runs a deployment without the UI: it builds the environment image, executes the steps, streams the log to the terminal, and exits non-zero on failure. It needs Docker, a keel.yaml in the current directory, and values for the variables.

Where values come from

In increasing precedence:
  1. Defaults declared in keel.yaml.
  2. A target’s saved values, with --target NAME — the values configured in keel dev on this machine.
  3. A var file, with --var-file path — NAME=value per line, # comments allowed.
  4. Flags, --var NAME=value, repeatable.
Values for variables the deployment does not declare are dropped, so one var file can serve several deployments. Before anything runs, the merged set is validated the same way the UI validates it; missing or invalid values are listed and the command exits with status 1.
--target reads .keel/dev.db in the repository and decrypts it with this machine’s dev.key. It works where the target was created in keel dev, not on another machine or in CI. For CI, use a var file or flags.
Without --target, the run’s KEEL_TARGET is cli.

Outputs

On success, declared outputs are printed:
Secret outputs, and outputs that contain a secret input’s value, are never printed.

In CI

A CI job is a machine with Docker, the keel binary, and the repository. Provide the values from the CI system’s secret store.
.github/workflows/deploy.yml
The same steps and the same environment image run in CI as on a laptop or in Keel Cloud, which is the point: there is one definition of the deployment.
For push-triggered deploys with saved per-target values and a run history, Keel Cloud with the GitHub App does this without a CI job. See GitHub App.

Exit codes and signals

  • 0 — every step succeeded.
  • 1 — a step failed, a value was missing or invalid, Docker was unreachable, or the configuration did not load. The message says which.
  • Ctrl+C (SIGINT) or SIGTERM cancels the run and removes the container; the command reports deployment canceled.

Other headless commands

The full option list is in the CLI reference.