Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Git deployments

Connect a GitHub or other Git repository, and pushes to the production branch publish automatically while every pull request gets a preview deployment.

Connect a repository

Prepare the repository

The repository needs a docs.yml (at the repo root, or in a fern/ or biti/ subdirectory; the CLI and platform look for docs.yml → docs.yaml → fern/docs.yml → biti/docs.yml → docs.json → mint.json in that order).

Fill in the dashboard

Open the site's "Settings → Git repository" and enter:

  • Repository URL: starts with https://, e.g. https://github.com/acme/docs.git.
  • Branch: the production branch, default main.
  • Access token: private repositories need a token with read access; to publish from the visual editor (pushing back to the repo) it also needs write access. Tokens are stored encrypted; leave the field empty later to keep the current one.

Click "Connect repository". The platform pulls the repo and starts a production deployment right away.

Configure the webhook

After connecting, the settings page shows a Payload URL and Secret. In your GitHub repo, go to Settings → Webhooks → Add webhook:

FieldValue
Payload URLThe URL shown on the settings page, like https://api.butterix.com/v1/webhooks/github/site_2m4k8p
Content typeapplication/json
SecretThe Secret shown on the settings page
EventsSelect Pushes and Pull requests

You can also connect via the API: Connect Git repository.

What triggers a deployment

GitHub eventConditionResult
pushPushed to the production branch set when connectingProduction deployment; the message is the first line of the commit message, and the commit SHA is recorded
pull_requestAction is opened, synchronize, or reopenedPreview deployment from the PR's source branch, with message PR #number: title
pingSent by GitHub when the webhook is addedReturns { "ok": true }
OtherReturns { "ignored": true }

Once a preview deployment finishes, open its own URL from the dashboard's deployment list. See Previews and rollbacks.

Security

  • Every request must carry an X-Hub-Signature-256 header. The platform computes HMAC-SHA256 with the site's Secret and compares in constant time, returning 401 on mismatch.
  • The webhook URL uses the site id (not the slug), and only sites connected to Git accept requests.
  • The platform only reads content from the repository and builds it in a separate worker thread; MDX never executes any code (see Safe subset).

Working with the visual editor

You can still use the visual editor after connecting Git:

  • Edits happen on a draft branch and can't modify the production branch directly;
  • "Publish" merges the draft into the production branch, pushes to the remote repository, and then triggers a production deployment (requires a token with write access);
  • Team members can commit from their IDE or edit in the editor; both are merged through Git.

Manual redeploys

The dashboard's "Redeploy" and "Create preview deployment" buttons rebuild from the latest commit in the repository. You can also call Create deployment with { "branch": "feature/x", "preview": true } to build any branch.

Disconnect

After "Disconnect", the site goes back to the ButterIX hosted repository; later pushes no longer trigger deployments, and webhook requests return 404.