Skip to main content

targon deploy

The targon deploy command deploys an application to Targon from a local Python file or configuration file.

targon deploy <TARGET> [OPTIONS]

Arguments

  • TARGET: The path to a Python application file or a configuration file (YAML/JSON) to deploy. The path must exist on your local machine.

When TARGET is a Python file, the CLI imports the Targon App object and deploys it. When TARGET is a YAML or JSON configuration file, the CLI loads the config and deploys accordingly.

targon deploy main.py
targon deploy deploy.yaml

Options

  • --name: Override the name of the deployment.
  • --config: Path to an additional configuration file (YAML/JSON). When provided, the config is used regardless of the target file type.

Example Workflow

import targon

app = targon.App("getting-started", image=targon.Image.debian_slim("3.12"))

@app.function()
def hello(message: str) -> dict[str, str]:
return {"message": message, "status": "success"}

Deploy the app:

targon deploy getting_started.py --name getting-started-demo

Or deploy from a config file:

targon deploy deploy.yaml

When to Use

  • Promoting a staging build into production.
  • Rolling out updates to long-running services.
  • Automating deployments in CI/CD pipelines (targon deploy is scriptable).
  • Deploying from a declarative YAML/JSON config without writing Python.

For iterative development, use targon run to execute local entrypoints without creating persistent deployments.