---
url: https://docs.zenavo.app/deploy/github
---

# GitHub

Deploy public and private repositories, and redeploy on every push.

## Connect GitHub

1. In a project, click **Add Service** → **GitHub**, or open **Team** → **GitHub**.
2. Click **Connect GitHub** and sign in with GitHub. If the Zenavo GitHub App is not installed on any account you can reach yet, GitHub asks you to install it first.
3. Zenavo lists the GitHub accounts and organizations the App is installed on that you can access. Click **Connect** next to one. Returning from installing the App connects it right away.

The team can then deploy **every repository the App can read** on that account. Which ones is chosen on GitHub, not in Zenavo: when you install the App, pick **All repositories** or **Only select repositories**. To change it later, click **Repositories on GitHub** next to the account on the team page; new repositories appear in Zenavo at once.

- Only team owners and admins connect GitHub. They can connect any organization the App is installed on that their GitHub account can access, but a personal account only when it is their own: GitHub also shows you other people's accounts where you collaborate on a repository, and Zenavo does not list those, because a connected account gives the team every repository the App can read there. Once connected, every member of the team can use its repositories.
- One account can be connected to several teams, for example your personal workspace and a company team. Each of them uses the same repositories.
- Zenavo gets read access to code and metadata, and push events.
- To install the App on another account or organization, choose **Install on another GitHub account or organization**.

**Disconnect** removes a GitHub account from this team only: the App stays installed on GitHub, and other teams keep their access. Connecting and disconnecting are recorded in the audit log.

## Add a repository

1. **Choose a repository.** Repositories are listed with the most recently pushed first; type to search.
2. **Choose a branch** or tag.
3. **Configure Build Plan:**
   - **Service Name**: any name up to 64 characters; you can rename the service later. Its permanent [ID](https://docs.zenavo.app/networking/private#service-ids) is made from this name.
   - **Root Directory**: for monorepos, the folder that holds this service, such as `/apps/web`.
   - **Environment Variables**: add rows, or click **Edit Raw Variables** to paste `KEY=value` lines.
   - **Advanced Settings**: the Dockerfile path, the HTTP port, and **Deploy automatically when this branch is pushed** (on by default).
4. **Build Plan Preview** shows how the service will be built: your Dockerfile, or the language and version detected by zbpack, plus the port. Click **Configure** to change something, or **Deploy**.

## Deploy on push

With automatic deploys on, every push to the branch builds and deploys the services that track it; the project's other services are left as they are. Pushes to other branches are ignored. Turn it on or off later on the service's **Settings** tab → **Auto deploy**.

## Watch paths

In a monorepo, a push to one app should not redeploy the others. On the service's **Settings** tab → **Watch paths**, enter one pattern per line; a push then deploys only when it changes a matching file. Leave it empty to deploy on every push.

Patterns use `.gitignore` syntax, read from the repository root (not the root directory), but select the files that **trigger** a deploy:

| Pattern | Deploys when a push changes |
|---|---|
| `apps/web/` | anything under `apps/web` |
| `/package.json` | `package.json` at the repository root only |
| `*.go` | any Go file, in any folder |
| `packages/**/src` | a `src` folder at any depth under `packages` |
| `!**/*.md` | not Markdown files, even inside a watched folder |

As in `.gitignore`, a pattern with a `/` at the start or in the middle is relative to the repository root, and one without matches at any depth. `*` and `?` stay within one folder name, `**` spans folders, and the last pattern that matches a file decides. Added, modified and removed files all count.

Zenavo reads the changed files from GitHub's push event. If the event does not list them (for example a push of more than 2,048 commits, or a branch moved to an existing commit), the service deploys anyway. Redeploying from the console or the CLI always deploys, whatever the watch paths.

A push deploys each auto-deploy service tracking that branch that watches a changed file. When that is every service of the project, it deploys the project.

### Paused after failed deploys {#auto-deploy-paused}

When three deploys of a service started by pushes fail in a row, pushes stop deploying it, so a broken branch does not build and fail on every commit. The service's page then shows **Auto deploy paused**. Fix the cause, then choose **Resume auto deploy**, or deploy it from the console or the CLI: a successful deploy resumes it too. Failed deploys you start yourself do not count.
