---
title: Deploying from GitHub
description: Connect the Dekka GitHub App, choose a repository and branch, and deploy on every push.
section: Services
order: 1
---

Dekka deploys a branch of a GitHub repository, and once the service exists every push to that branch starts a new deployment. Dekka builds the code itself, so you don't need a CI pipeline to deploy.

## How does Dekka get access to my repository?

Through the Dekka GitHub App. The first time you choose **Add**, then **GitHub repository**, Dekka asks you to install the app on the GitHub account or organisation that owns the repository. You decide which repositories it can read, and you can change that in GitHub at any time. The app asks for read access to repository contents and metadata, and for write access to commit statuses.

If the repository you want isn't in the list, the app probably doesn't have access to it. Open the app's settings on GitHub and add the repository.

## What happens when I push?

GitHub tells Dekka about the push, and Dekka checks that the request is signed by GitHub and ignores any delivery it has already handled. It then starts a deployment for every service that tracks that repository and branch and has **Deploy on push** turned on. A newer deployment cancels any deployment of the same service that hasn't finished.

A stopped service doesn't deploy on push, and neither does one whose [watch paths](/docs/build-configuration#deploy-only-when-certain-files-change) don't match any changed file.

## Turn off deploys on push

Open the service's **Settings**, turn off **Deploy on push** and stage the change. The service then deploys only when you choose **Deploy** in its details panel or **Redeploy** on a deployment.

## Deploy a monorepo

Add one service for each application in the repository, and set each one's **Root directory** to its folder, such as `/apps/api`. Dekka builds from that folder and looks for [`dekka.toml` or `dekka.json`](/docs/config-as-code) there. Add [watch paths](/docs/build-configuration#deploy-only-when-certain-files-change) so a push that only touches one application doesn't redeploy the others.

## Deploy a specific branch or commit

Choose **Deploy** in the service's details panel to deploy the head of its branch now. To deploy a particular commit, use the API:

```bash tab="cURL"
curl https://api.dekka.cloud/v1/resources/$SERVICE_ID/deployments \
  -H "Authorization: Bearer $DEKKA_API_KEY" \
  --json '{ "branch": "main", "commit_sha": "4f2a9c1" }'
```

Both fields are optional. Without them Dekka deploys the head of the service's branch, and a branch that doesn't exist answers 422 `branch_not_found`.
