Email VPS
Support
Guides Contact Us
Hosting guides

Deploying your site from git

Deploying your site from git

You can deploy your site straight from GitHub or GitLab. Every new version on the branch is deployed automatically, and you can go back to the previous version with one click. SFTP keeps working alongside.

Git deploy is available on sites on our new platform. You find it in your account under Web hosting by opening the site and the Deploy from git section. If the section says git deploy is not included in the plan, contact support.

1. Turn on git deploy

  1. In your account open Web hosting, choose the site and open Deploy from git.
  2. Enter the repository address in SSH form, for example git@github.com:company/site.git, and the branch, usually main.
  3. Choose the site type. Static or directly public site deploys the repository as it is. Application (for example Laravel or Symfony) deploys the application and serves only the public directory, usually public.
  4. Add a build command and persistent paths if needed (see below).
  5. Click Turn on git deploy.
  6. The webhook secret appears. Save it right away, it is shown only this once. If you lose it, you can create a new one under More actions.

2. Add the deploy key to the repository

Your account shows the public key created for the site. It lets the server read the repository but not write to it.

  1. Copy the key from your account.
  2. On GitHub open the repository and choose Settings, Deploy keys and Add deploy key.
  3. Paste the key and give it a name. Leave Allow write access unchecked.

3. Add a webhook for automatic deploys

On GitHub open the repository Settings, Webhooks and Add webhook, and fill in the form like this:

  1. Payload URL: paste the webhook address from your account.
  2. Content type: choose application/json from the menu. A different option is selected by default, so this has to be changed.
  3. Secret: paste the webhook secret you saved when turning git deploy on.
  4. Which events: choose Just the push event.
  5. Click Add webhook. GitHub sends a test message, and a green mark appears next to it when everything is right.

4. Make the first deploy

Click Deploy now in your account. The status and log of the deploy are shown in the deploy history. After that every push to the branch is deployed automatically.

Build command

The build command runs before the deploy, for example npm ci && npm run build. It may take at most 15 minutes. Composer is not preinstalled, so use php composer.phar install or commit the vendor directory to the repository.

Persistent paths

Every deploy replaces the site files with the new version. Paths marked as persistent are kept from one deploy to the next, so mark for example storage, .env and files uploaded by users, such as uploads.

Rolling back

In the deploy history each successful deploy has a Roll back to this version button. The rollback is immediate. You choose how many versions are kept in the settings.

Good to know

  • A failed deploy does not change the site, the previous version stays live. The reason is shown in the deploy log.
  • Git submodules and LFS files are not deployed.
  • Git deploy settings can be changed by the primary user and the technical contact.