DEPLOYMENT
GitHub Deployment: Connect a Branch to Static Hosting
Connect a GitHub repository intentionally, select a deployment branch, and use commit and release history to debug or roll back safely.
TL;DR: Install a GitHub App on the repositories you intend to publish, link a dedicated branch, and decide whether pushes should build only or also publish. Treat the recorded commit and the live release ID as different facts.
Introduction
GitHub deployment is handy when several people edit a site or you release often. It connects a Git commit to a build so you do not have to manually assemble a ZIP for each change. It also means a branch change can become a public release, which is a decision worth making deliberately.
Start with one repository, one branch, and manual publishing. Once the output and review process are predictable, enable automatic behavior at the narrowest scope your team needs.
What is GitHub deployment?
GitHub deployment uses an authorized repository connection to retrieve source at a specific Git revision and produce a hosted release. It does not mean hosting is provided by GitHub itself. For KairoBase, a GitHub App installation defines which repositories the app can see, and user authorization allows KairoBase to act within the overlap between that installation and the user's access.
A commit hash pins contents even if the branch moves. A branch is a convenient trigger and selection mechanism; it is not a frozen record of exactly what visitors received last week.
Why configuration should be narrow
- Install an application on selected repositories when you can. It doesn't need your unrelated organization projects to deploy one site.
- Use a durable branch such as
mainorproduction. Avoid building every temporary branch into the same public hostname. - Decide whether changes are reviewed before merging, before publishing, or at both points. A small project may combine those steps; a customer-facing launch may not.
How the workflow fits together
Authorize the repository and branch
Install the configured KairoBase App and authorize your GitHub account from the workspace. Select an installation, repository and branch, and choose static files or a supported npm build. For private repositories, you must keep both the app installation permissions and your account access valid. If an organization enforces SSO, make sure authorization was completed in the relevant organization context.
Decide what a push can do
One option uses GitHub only as a source when a release is queued manually. Another builds after verified pushes to the linked branch. A separate automation setting can publish the ready result. Manual publishing is a useful starting point: successful build status does not tell you whether the changed page looks right.
Verify the commit and public result
When a release finishes, compare the commit shown in its history with GitHub's branch or pull request view. If someone pushes while your build runs, use the commit on the actual job rather than guessing from the branch name. After publication, check the domain and record the release reference in your team notes if it matters operationally.
| Operation | What it changes | What it does not prove |
|---|---|---|
| Push | Advances a branch in GitHub | A release has built |
| Build | Produces a static artifact | Visitors are seeing that artifact |
| Publish | Selects a ready release for the host | Every external integration is healthy |
Practical steps
- Choose a branch, check in the lockfile for npm projects and document the output directory.
- Set up the repository connection and queue the first release manually. Confirm the pinned commit in the logs.
- Publish and smoke-test the homepage and a deep link. Test a minor follow-up change before enabling automatic publishing.
- Keep at least one known-good release and note how to redeploy it without rebuilding the branch.
Common mistakes
- Connecting a repository the GitHub App has never been installed on.
- Building a branch with a different output directory than the one configured in the workspace.
- Turning off webhooks but assuming an existing automatic publication setting will follow a different repository or branch.
Frequently asked questions
Can I use a private repository? Yes, where configured and permitted by your GitHub App installation and account. Access can be revoked through GitHub.
Will every GitHub push be published? Only if the relevant branch is connected, automation is enabled, the job succeeds and the publication configuration is ready.
Do I need to configure GitHub to use KairoBase? No. A ZIP or installed static template is an alternative.
Is the latest commit always live? No. Check the release status and commit to determine which version was selected.
How do I pause automatic releases? Turn off build automation or automatic publication in the repository settings as appropriate. An already-running job may still need to be canceled separately.
Conclusion
Use the smallest repository permission set that lets your workflow run, and keep the deployed artifact tied to a commit. Read repository connection in the workspace docs, and see GitHub’s App installation instructions.