# Deploy from GitHub

> Install the 00b5e2 GitHub App, pick a repo, and every push deploys. Main goes to development, every pull request gets its own preview on .dev, and production stays manual unless you set it to follow main.

## Connect a repo

Install the app on your GitHub account or organisation and choose which repos it can read. Then link a repo to a project from the console, the CLI or your agent.

```sh
$ 00b5e2 git connect noa/my-site
connected noa/my-site to my-site
```

## What a push does

| when | what happens |
| --- | --- |
| `main` | deploys to development, my-site.00b5e2.dev |
| `a pull request` | a preview at my-site-git-<branch>.00b5e2.dev |
| `merged or closed` | its preview is deleted; the next push brings it back |

> A deploy only goes live when its checks pass. If a check fails, what was live stays live.

## Disconnect

Unlink the repo, or uninstall the app on GitHub. The project, its deploys and its data stay.

```sh
$ 00b5e2 git disconnect
```

Previous: [Connecting services](https://docs.00b5e2.com/connecting-services.md)
Next: [Environments](https://docs.00b5e2.com/environments.md)
