> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy from GitHub | Agent guide

> Link a GitHub repository, validate Plays in pull requests, and deploy them from your production branch.

[Human guide: task steps and agent prompt →](https://deepline.com/docs/human/sdk-v2/git-deploys.md)

Git deploys builds committed Play files from a linked GitHub.com repository.
Ready pull requests register draft revisions; pushes to the production branch
promote changed Plays. You need no Actions workflow or Deepline key in GitHub.

Git deploys is in beta and requires org enablement. Request access
through the support button on your Deepline dashboard. Use
[Deploy with GitHub Actions](https://deepline.com/docs/sdk-v2/github-deployments.md) for restricted
organizations or GitHub Enterprise Server.

## Before you start

You need:

* Org owner or admin access.
* Permission to install the Deepline GitHub App for the repository.
* Committed `*.play.ts` files for this Play deployment.
* The intended org, production branch, root directory, and file selection.

Keep provider credentials and active Play secrets in Deepline. Keep credentials,
customer data, and live provider responses out of the repository.

Anyone who can push to the production branch can change the Plays in this
org. The App requests repository contents, metadata, and pull-request
read access, plus check-run write access. Its registration also requests email
read access for GitHub sign-in.

## Connect and link the repository

1. Open **Deploys** in Deepline.
2. Select **Connect GitHub**.
3. Install the App on the account or organization that owns the repository.
4. Grant access to the selected repositories.

![Deploys page with the Connect GitHub button](https://mintcdn.com/deepline2/H1mimOdvGMz_VkJe/images/git-deploys-connect-github.png?fit=max\&auto=format\&n=H1mimOdvGMz_VkJe\&q=85\&s=f571b6e443eac326a83a6755650ce470)

GitHub returns you to the repository-linking dialog. If GitHub is already
connected, select **Link a repository** instead.

5. Select the repository in that dialog.
6. Set the production branch, root directory, and manifest filename.
7. Confirm the link.
8. Check the saved settings under **Repositories**.

| Setting | Meaning |
| - | - |
| Production branch | Pushes to this branch start production deployments. |
| Root directory | Base directory for discovery; empty means the repository root. |
| Manifest | JSON filename under that directory; defaults to `deepline.json`. |
| Pull-request checks | Enabled by default; change this setting on the linked repository. |

Linking does not deploy existing commits. The next production-branch push starts
a deployment. Other branch pushes need a pull request to trigger validation.

A repository can have links for different root directories or manifest paths.
Within one GitHub installation, an active repository/root/manifest target cannot
be linked twice, including across orgs. Review overlap warnings before
confirming another target.

## Select the complete file set

Without the default manifest, discovery includes `**/*.play.ts` and
`**/*.monitor.json` below the linked root. To select Plays without Monitor
files, commit this `deepline.json`:

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "plays": ["plays/**/*.play.ts"],
  "monitors": []
}
```

Globs are relative to the linked root. They cannot be absolute or contain `..`.
A missing explicitly configured custom manifest fails the deployment.
Each deployment supports at most 100 Play files. A Play's imports must stay
within its directory or child directories.

To deploy Monitor files, select their globs and follow
[Monitor file deployment](https://deepline.com/docs/plays/set-up-a-monitor.md#deploy-monitor-files-from-git).
Monitor access, admission, and Deepline-credit rules still apply.

Production deployments apply Monitor definitions through Monitor Jobs. Provider
changes can remain after a later failure; Play promotion does not roll them back.
Stopped Monitors stay stopped. Removing a file or changing its glob does not
delete an existing Monitor. Inspect Monitor Jobs before retrying or retiring it.

## Validate a pull request

Open a ready pull request from a branch in the linked repository.
Deepline creates a **Deepline Plays** check. Multiple deployment targets can add
org/root details to its name.

A successful check validates changed Plays and registers draft revisions.
It leaves live revisions unchanged. Every deployment registers its own revisions and
makes live only those, so a check running while a production deploy publishes
cannot change what that deploy makes live. Selected Monitor definitions are checked
without creating Monitor Jobs or provider resources.

Draft pull requests do not build. Mark a draft ready for review to start its
first build. Fork pull requests receive no Deepline build or check.

Copy a registered revision ID from the deployment details to run it before merge:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
REVISION_ID="revision-id-from-deployment-details"
deepline plays run --revision-id "$REVISION_ID" \
  --input '{"example":"value"}'
```

Replace the example input with the Play's actual input. This starts a Play run
and can use Deepline credits.

## Deploy and inspect the result

Merge the pull request or push committed changes to the configured production
branch. Open **Deploys**, or inspect the deployment through the CLI:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline git deployments
DEPLOYMENT_ID="deployment-id-from-the-list"
deepline git deployments "$DEPLOYMENT_ID"
```

Deepline validates changed Plays before promoting their live revisions together.
Unchanged Plays are skipped by content hash. Monitor provider effects remain
separate from this Play promotion.

Check the selected commit, org, per-Play outcomes, warnings, and Monitor
Jobs. Terminal states include `succeeded`, `succeeded_with_warnings`, `failed`,
`reconcile_failed`, `cancelled`, and `superseded`. Build compute is metered;
deployment details show build duration.

An admin can cancel before Plays go live:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline git cancel "$DEPLOYMENT_ID"
```

Cancellation does not undo Monitor changes already submitted. Inspect their
Jobs in the receipt. Cancellation is refused after the Plays are promoted.

## Roll back from source

Revert the source commit. Push the revert to the production branch.
Inspect the new deployment and its live revisions.
A revert creates another deployment; it does not reverse earlier provider
effects automatically. Review Monitor Jobs separately.

## Pause or remove a link

Use **Repositories** to change settings, pause deployments, or unlink a
repository. The CLI exposes the same controls. Get the link ID from
`deepline git list`:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
LINKED_REPOSITORY_ID="id-from-deepline-git-list"
deepline git set "$LINKED_REPOSITORY_ID" --disabled
```

Use `--enabled` to resume. Update the branch, root, manifest, or pull-request
checks with `deepline git set`; its help lists the options.

To release repository ownership:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline git unlink "$LINKED_REPOSITORY_ID"
```

Confirm the link's new state with `deepline git get "$LINKED_REPOSITORY_ID"`.
Pausing or unlinking stops new deployments; live Plays and existing Monitors
continue. Decommission schedules, webhooks, callers, and Monitors explicitly.

> [accordion] Connect and link through the CLI
>
> Use an authenticated CLI in the intended org. `git connect` opens the
> browser installation flow; the remaining commands inspect or create the link.
>
> ```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
> deepline git connect
> deepline git status
> deepline git repos
> deepline git link acme/growth --branch main
> deepline git list
> deepline git get LINKED_REPOSITORY_ID
> ```
>
> Replace `acme/growth` with a repository from `git repos`. Take the link ID from
> `git list`. With multiple installations, pass the selected `--installation <id>`
> to `git repos` and `git link`.
>
> Use `--root-dir packages/growth` for a monorepo or `--manifest <filename>` for
> another manifest. `--no-pr-checks` disables pull-request checks. Add `--json`
> for structured output. Push committed changes to the configured production
> branch, then inspect the deployment as described above.

> [accordion] Restore GitHub access or resolve a manual override
>
> Use `deepline git status` to inspect installation state and affected links.
> After an uninstall, reconnect GitHub and recreate affected links with their
> original settings. Links from the old installation cannot be resumed.
> For a suspended installation, restore access in GitHub and inspect each link
> before resuming deployments.
>
> A directory deployment or manual publish can replace a repository-owned live
> Play. Deepline reports the difference from the linked repository; the next
> owner push replaces that revision. Choose one deployment owner. Use the
> [Actions guide](https://deepline.com/docs/sdk-v2/github-deployments.md#a-play-a-linked-repository-owns)
> for the ownership handoff.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.