# Deploy from Git

Koo builds and deploys a web service straight from a GitHub repository. Pick a repo and branch, and every deploy runs a [build](/docs/deploy/builds) and ships the result as a new immutable [deployment](/docs/deploy/deployments-and-rollback) — with logs, metrics, and rollback working exactly as they do for any other deploy. Prefer a different path? Bring a prebuilt image with [Deploy a container](/docs/deploy/deploy-a-container), or deploy the directory on your machine with [koo up](/docs/deploy/koo-up).

## Connect a repository

1. 
2. 
3. 
4.

Creating the service is a [staged change](/docs/projects/staged-changes) like any other: the first build starts when you press Deploy. GitHub is the supported provider today.

## Manage the connection

The GitHub connection belongs to the account, not to one service — every Git-backed service in the account builds through it. You can manage it from anywhere a Git-backed service is:

- 
-

> **Warning:**
>
> Disconnecting removes the connection for the whole account: every Git-backed build in it fails until you connect again. The console asks you to confirm first.

Managing the connection needs the editor role or higher — see [Teams & roles](/docs/collaboration/teams-and-roles).

## What a deploy builds

A deploy you start yourself builds the current head of the tracked branch. A deploy triggered by [auto-deploy](#auto-deploy-on-push) builds the exact commit that was pushed — never a later head of the branch.

## Change the source

In the console, a service's source is set when the service is created — the drawer's **Settings → Source** shows it read-only. To move a service to a different repository, branch, or source kind, update its `source` through the [services API](/api/services) (the change deploys from the new source), or create a new service and delete the old one.

## Auto-deploy on push

Auto-deploy is opt-in per service and off by default: turn it on with the **Auto-deploy** toggle in the service's Settings. Once it's on, a push to the tracked branch arrives as a signature-verified webhook, and Koo queues a build and deploy of the pushed commit — no console visit needed.

Auto-deploy requires a paid plan — see [usage and limits](/docs/account/usage-and-limits). Leaving the toggle off keeps deploys manual: the service only ships when you deploy it yourself.

## Build in your own CI instead

Prefer to keep the build on your side? Build the image in your CI, push it to a registry, and deploy it as a container. You keep the full deploy pipeline — versioned deployments, rollback, live status — the only part you supply is the build.

1. Build and push the image from your CI pipeline:

   ```bash
   docker build -t registry.example.com/you/app:abc123 .
   docker push registry.example.com/you/app:abc123
   ```
2. Deploy that image to your web service, as described in Deploy a container.

To trigger that deploy from the pipeline itself, authenticate your CI with an [API token](/docs/developers/api-tokens) and call the API; or start the deploy from the console after your CI pushes the image.
