Deploy on git push
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. See Repository connect for the reference.
Prerequisites
- A Project. This tutorial uses
acme. - A GitHub repository containing a committed
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.
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. The push opens a deploy journey card that tracks the run through its stages.
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 on an
ephemeral endpoint that never touches production routing.
Open the pull request on GitHub. Hyjal posts the preview URL as a status check:
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
acmeProject 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: preview lifecycle, expiry, and isolation.
- Deploy from CI: scoped deploy tokens for any CI system.
- Rollbacks: repoint an endpoint to a previous artifact.