Skip to main content

GitHub Integration

The GitHub integration allows you to automatically deploy your Nhost project when on push and merge to a GitHub repository that is connected to your Nhost project.

When a GitHub repository is connected to a Nhost project, Nhost automatically deploys changes when you push code to the repo.

The following things are deployed:

  • Database migrations
  • Hasura metadata
  • Serverless Functions
info

Settings in nhost/config.yaml are not deployed. That means you need to manually sync settings between local and remote environments between the CLI and Nhost Cloud.

Connecting a GitHub repository

  1. From your Nhost project, click Connect to Github.

Connect to GitHub

  1. Install the Nhost project on your Github account.

Install the Nhost GitHub App

  1. Connect your Github repository.

Select reopsitoru

Deployment Branch

Nhost only deploys your deployment branch. By default, your deployment branch matches the default branch set on GitHub (usually main).

You can change the deployment branch by clicking Edit next to the repository in your Nhost project's Overview.

You can have multiple Nhost projects connected to the same GitHub repository and use different deployment branches (e.g., main and staging).

drawing

Base Directory

If your Nhost project is not at the root of your git repository (typically when using a monorepo), you can set a custom base directory. The base directory is where the nhost directory is located. In other words, the base directory is the parent directory of the nhost folder.

drawing

Next Steps