> Index of every page on this site: [llms.txt](https://docs.a-line.cloud/llms.txt)

# Deploy an app from GitHub

> Build a container from a GitHub repository and redeploy it on every push.

**Goal**: an app that A-Line.cloud builds from your repository and deploys
again whenever you push to a branch.

## Before you start

- A [project](/getting-started/create-project) on a running cluster.
- A repository with a `Dockerfile`, or a Node.js project with a
  `package.json` (A-Line.cloud detects a build preset for it).
- For private repositories and automatic deploys: GitHub connected under
  **Settings > Integrations > Connect GitHub**. A public repository works
  without it, but only deploys when you start it by hand.

## Steps

<Steps>
<Step>

On the project canvas, select **From Git** in the sidebar. The **Deploy
from Git** dialog opens.

</Step>
<Step>

**Repository**. Under **Repository source**, pick **Connected repos**
(through the GitHub App) or **Public repository** (paste any public URL).
Choose the repository and the **Branch**. Leave **Deploy as** on
**Container**. If the repository looks like a static site, the dialog
marks **Static site** as **Detected**; see
[Deploy a static site](/guides/static-site) for that path. Select **Next**.

</Step>
<Step>

**Build**. Check the **Build Preset** (detected from `package.json`),
or set the **Dockerfile Path** and **Build Context**. Add **Build
Arguments** if your Dockerfile needs them. Select **Next**.

</Step>
<Step>

**Trigger** (connected repos only). Under **Automatic Deploy Trigger**,
pick **On push to branch** and enter a branch pattern such as `main` or
`release/*`. You can deploy on tags instead: **On pre-release** or **On
full release** with a tag pattern such as `v*`. Select **Next**.

</Step>
<Step>

**Settings**. Enter the app's **Name**, the **Port** your app listens
on, the number of **Replicas** and any **Environment Variables**.

</Step>
<Step>

Select **Create & Deploy**.

</Step>
</Steps>

## Verify

Open the app and go to the **Deploys** tab. The first deploy shows its build
log, then moves through `building` and `deploying` to `succeeded`. Push a
commit to the branch: a new deploy starts on its own.

To reach the app from a browser, [add a domain](/guides/custom-domain).

## Troubleshooting

- **No GitHub connection**: connect GitHub under **Settings >
  Integrations**, or switch to **Public repository**.
- **The build fails**: open the deploy on the **Deploys** tab and read the
  build log. Most failures are a wrong **Dockerfile Path** or **Build
  Context**, or a missing **Build Argument**.
- **A push did not start a build**: check the branch pattern of the trigger.
  If the build history shows a `refused` entry, your balance is out of credit
  or the monthly spend cap is reached; see
  [refused builds](/concepts/builds-and-deploys#refused).
- **The deploy never becomes ready**: check that **Port** is the port the
  process listens on, and read the **Logs** tab.

## Next steps

- [Add a custom domain](/guides/custom-domain)
- [Add a database and connect the app](/guides/managed-database)
- [Store secrets](/guides/secrets)
- [Builds and deploys](/concepts/builds-and-deploys): how builds, rollouts and
  rollbacks work.
- [Apps in IaC](/iac/apps): the same app as a file in Git.
