---
title: Deploy from GitHub
description: Connect your GitHub account, then build and deploy an application from a repository and redeploy it on every push.
---

Kapten can build your application from a GitHub repository and deploy it again on every push to a branch. You do not need a Dockerfile: Kapten builds the image with [Railpack](https://railpack.com), which detects your language and framework.

## Connect GitHub

Kapten reads your repositories through the **Kapten GitHub App**. It asks only for read access to their contents and metadata, and for push events.

1. **Install the GitHub App**

    In the [Kapten console](https://app.kapten.io), open **Integrations**, then **Connect GitHub**. GitHub asks which account to install the app on, a personal account or an organization, and which repositories it can read: all of them, or the ones you select.

2. **Come back to Kapten**

    GitHub returns you to Kapten, which lists the installation. Every member of your organization allowed to configure components can now build from these repositories.

To give Kapten access to more repositories later, change the installation's repository access on GitHub, then refresh the list in Kapten.

## Create the application

1. **Choose the source**

    In your environment, create an application and choose **GitHub** as its source. Select the installation, the repository and the branch to deploy.

2. **Set the build**

    **Build context** is the folder Kapten builds from, relative to the repository root: `.` by default, or a folder such as `services/api` in a monorepo. Set the CPU and memory the build may use, and its timeout.

3. **Choose when to build**

    With automatic builds on, Kapten builds and deploys on every push to the branch. **Path rules** narrow that down:

    | Rule | Kapten builds when |
    | --- | --- |
    | No path filter | Any file changed. |
    | Include | At least one changed file matches a pattern. |
    | Exclude | At least one changed file matches none of the patterns. |

    Patterns are relative to the repository root and case-sensitive, for example `services/api/**`.

4. **Configure and deploy**

    Set the application's ports, resources and health checks (see [Applications](/concepts/components#applications)), then **Create and deploy**.

Each build and deployment is a run of the application: open it to follow the build, the deployment and their logs.

## Disconnect GitHub

Disconnecting an installation in **Integrations** stops new builds from its repositories. The GitHub App stays installed on GitHub, and past runs are kept. Uninstall the app from your GitHub settings to remove its access entirely.
