Git Deployments

ServerPlane lets you connect a GitHub repository to any app and deploy code directly from a branch. Each deployment pulls the latest code, runs your build and deploy commands, and restarts the app automatically.

Prerequisites

  • Your GitHub account must be connected for repo access. See Connecting Your GitHub Account.
  • The app must already be created and deployed on a server.

Connecting a Repository to an App

  1. Open your app's detail page and go to the Git & Deploy tab.
  2. Click Browse Repos to load your repositories. You can also type in the search box and press Enter to filter by name.
  3. Click a repository from the list to select it. Both public and private repos are supported. Private repos are labeled with a badge.
  4. After selecting a repo, the branch dropdown appears. ServerPlane auto-selects main or master if either exists. Choose a different branch if needed.
  5. Click Connect Repository.

When you connect, ServerPlane automatically:

  • Generates a deploy key and adds it to your GitHub repository (read-only). This allows the server to pull code without needing your personal credentials.
  • Registers a webhook on the repository for push events (used for auto-deploy, covered in Auto-Deploy & Webhooks).
  • Enables auto-deploy by default.

Once connected, the tab shows the connected repo name, branch, and a green "Connected" badge.

Build & Deploy Commands

After connecting a repo, scroll down to the Build & Deploy Commands section:

  • Build Command — Runs after code is pulled. Example: npm install && npm run build. Leave empty to skip.
  • Deploy Command — Runs after the build step. Example: php artisan migrate —force. Leave empty to skip.

Click Save Settings to persist your commands. The app restarts automatically after the deploy command completes.

Triggering a Manual Deploy

  1. In the Git & Deploy tab, find the Deploy section at the top.
  2. Click Deploy Now.
  3. Confirm the dialog. A deployment job is queued immediately.
  4. Switch to the Deployments tab to monitor progress.

Manual deployments pull the latest commit from the configured branch.

Disconnecting a Repository

  1. In the Git & Deploy tab, click the Disconnect link in the top-right corner of the repository card.
  2. Confirm the dialog.

Disconnecting removes the deploy key and webhook from GitHub and clears all Git configuration (repo URL, branch, build/deploy commands, auto-deploy setting) from the app. The deployed code on the server is not removed.