Deploy from Git

Last verified

Connect a repository once and ship by pushing code. Works with GitHub, GitLab, or any Git host.

Set it up

  1. Open Sites → your site → Deploys, then Deploy from Git (the side panel's Connect your repository button opens it too).

  2. Connect your Git account with the Connect button for your host, then pick a repository and press Use this. Private repositories work this way with no keys to copy. On GitLab self-hosted, Gitea, Forgejo or Codeberg, open Using GitLab self-hosted, Gitea, Forgejo or Codeberg? and paste your host's address and a read-only access token.

  3. Or, under Or deploy from any Git URL, enter the Repository:

    • https://github.com/you/repo for a public repository,
    • git@github.com:you/repo.git for a private one,

    then the Branch / tag, and press Deploy from Git.

We clone the repository, run the build steps detected from your project and publish the result. Progress shows at the top of the tab.

Your connected Git accounts are listed under Settings → Developer → Git & SSH, where you can also disconnect one.

Build steps

Once a repository is connected, Build steps on the Deploys tab shows what runs before publishing: Install, Build and Tests. Override any of them, type skip to turn one off, or leave Install or Build empty to detect it again (an empty Tests means no tests). If the test command fails, the build stops and your site is not updated. Tick Run database migrations after deploying if your app needs it, and press Save build steps.

With a staging copy, set its branch under Staging copy: pushes to that branch deploy to staging instead of the live site. Any other branch is ignored.

Private repositories with an SSH URL

If you use a git@ URL, the panel shows Your deploy key (private repositories). Add it as a read-only deploy key in your repository settings (GitHub: Settings → Deploy keys; GitLab: Settings → Repository → Deploy keys), then deploy again. Repositories picked through a connected Git account don't need one.

Deploy on every push

When you pick a repository through a connected Git account, we normally add the push webhook to your repository ourselves, and Auto-deploy on push says On. Otherwise the panel shows Auto-deploy on push with a webhook URL and Secret: add both as a push webhook in your repository (GitLab: put the secret in Secret token).

Choose when a push deploys

Under Deploy trigger you pick what a push does, then press Save deploy trigger:

  • On every push (the default). A push to your branch deploys the live site, and a push to your staging branch deploys the staging copy.
  • On release tags. Only pushing a tag that matches your Release tag pattern deploys, and we deploy that tag. Branch pushes are ignored. The pattern uses letters, numbers and * . - _ /: v* (the default) matches v1.2.3, and release/* matches release/2026-11. Deleting a tag never deploys. The Deploy button still deploys your branch, not a tag.
  • Manually. Pushes never deploy. Deploy from the Deploys tab, the API, or the webhook call below when you are ready.

Deploy now from CI, in any mode. A call to the webhook URL with your secret and no branch or tag in it is not a push: it deploys your branch straight away, whichever trigger you chose. That is how a pipeline deploys a site set to Manually:

curl -X POST -H "X-Veldhost-Token: SECRET" WEBHOOK_URL

Whichever you choose, the webhook stays connected and the side panel still shows when the last push arrived. The API sets the trigger with deploy_mode and release_pattern on PATCH /sites/{slug}/build.

Redeploy without a push

Build & deploy in the side panel rebuilds the code already on the site: Composer install, then your database migrations if they are on in Build steps. It runs straight away and is not held for approval. On a Node.js site it is Install & restart. Plain HTML and PHP sites don't need it.

Stuck? Contact support — replies within one business day.