> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.hyjal.cloud/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.hyjal.cloud/_mcp/server.

# Deploy on git push

> Connect a GitHub repository from the Console so every push to the default branch deploys and every pull request gets a preview deploy.

This tutorial connects a GitHub repository to a Project so deploys happen on
push. You will connect the repo from the Console, push a commit to the default
branch to trigger a production deploy, follow the deploy on the Project's
journey card, and open a pull request to get a preview deploy. It takes about
ten minutes.

Once a repository is connected, every push to the default branch builds and
deploys, and every pull request gets an isolated
[preview deploy](/deploy/ci/preview-deploys). See
[Repository connect](/deploy/ci/repo-connect) for the reference.

## Prerequisites

* A Project. This tutorial uses `acme`.
* A GitHub repository containing a committed [`hyjal.toml`](/deploy/hyjal-toml).
* Owner or maintainer access to the repository, to authorize the connection.

## 1. Connect the repository

In the Console, open the Project and go to **Config → Repository**. Select
**Connect repository**, choose the GitHub account or organization, and pick the
repository. Confirm the default branch (`main`) and the connection.

The Console records the connection and the default branch. From this point,
pushes and pull requests on the repository drive deploys.

## 2. Push to the default branch

Commit a change and push to `main`. The push triggers a production build and
deploy of every Resource in the manifest.

```bash
$ git add .
$ git commit -m "Update landing copy"
$ git push origin main
```

The build runs the same recipe as `hyjal deploy` run locally: it builds each
Resource, uploads artifacts, applies policy, and flips routes atomically.

## 3. Follow the journey card

Open the Project on [the Board](/platform/the-board). The push opens a deploy
journey card that tracks the run through its stages.

```text
acme: deploy from main @ 3f9c2a1
  Build ......... ✓ web, api
  Upload ........ ✓ sha256:9f2c1a…e4b7
  Policy ........ ✓
  Route ......... ✓ flipped

  Live: https://web--acme.hyjal.cloud
```

When the card reaches **Route**, the new artifact serves production traffic.
If a build step fails, the card stops at that stage and the previous artifact
keeps serving; nothing flips until the build succeeds.

## 4. Open a pull request for a preview

Create a branch, push it, and open a pull request against `main`. The pull
request gets its own [preview deploy](/deploy/ci/preview-deploys) on an
ephemeral endpoint that never touches production routing.

```bash
$ git checkout -b preview-nav
$ git commit -am "Try new navigation"
$ git push origin preview-nav
```

Open the pull request on GitHub. Hyjal posts the preview URL as a status check:

```text
https://web--acme--preview-42.hyjal.cloud
```

The preview endpoint follows the grammar
`https://<resource>--<project>--preview-<n>.hyjal.cloud`. It rebuilds on every
push to the pull request and expires after 72 hours of inactivity. Merging the
pull request deploys the merged commit to production through the same path as
step 2.

## What you built

* A GitHub repository connected to the `acme` Project from the Console.
* Production deploys triggered by every push to `main`, tracked on the journey
  card.
* Isolated preview deploys for every pull request.

## Next steps

* [Preview deploys](/deploy/ci/preview-deploys): preview lifecycle, expiry,
  and isolation.
* [Deploy from CI](/deploy/ci/deploy-from-ci): scoped deploy tokens for any CI
  system.
* [Rollbacks](/deploy/rollbacks): repoint an endpoint to a previous artifact.