Skip to content

Deploy from Git

Deploy directly from any Git repository with automatic builds on push.

Creating a Git Deployment

  1. Go to Deployments tab
  2. Click New Deployment
  3. Select From Git Repository
  4. Fill in the configuration

Configuration

FieldDescriptionExample
NameDisplay nameMy API
SubdomainPublic URL prefixapi
Repository URLGit clone URLhttps://github.com/user/repo.git
BranchBranch to deploymain
Dockerfile PathPath to DockerfileDockerfile

Private Repositories

For private repos, include credentials in the URL:

https://username:token@github.com/user/private-repo.git

Or use SSH (requires SSH key on server):

git@github.com:user/private-repo.git

Dockerfile Requirements

Your repository must contain a Dockerfile. If it doesn’t:

  1. Add a Dockerfile to your repo
  2. Or use Local Project deployment (auto-generates Dockerfile)

Example Dockerfiles

Node.js (Express)

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "index.js"]

Python (FastAPI)

FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]

Go

FROM golang:1.22 AS builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o server .
FROM alpine:3.19
COPY --from=builder /app/server /server
EXPOSE 8080
CMD ["/server"]

Triggering Deploys

Manual Deploy

  1. Go to the deployment
  2. Click Deploy Now
  3. Watch the build logs

Automatic via Webhook

Set up GitHub webhooks for automatic deploys on push.

See GitHub Webhooks for setup instructions.

Build Process

When you trigger a deploy:

  1. Clone — Git clone the repository
  2. Checkout — Switch to configured branch
  3. Build — Run docker build
  4. Push — Push image to internal registry
  5. Stop — Stop existing container (if any)
  6. Run — Start new container
  7. Health Check — Verify container is healthy

Branch Strategies

Deploy main to production:

main branch → api.hosted.yourdomain.com

Multiple Deployments

Create separate deployments for different branches:

main branch → api.hosted.yourdomain.com
staging branch → api-staging.hosted.yourdomain.com

Monorepo Support

For monorepos, specify the Dockerfile path:

my-monorepo/
├── apps/
│ ├── api/
│ │ └── Dockerfile # Path: apps/api/Dockerfile
│ └── web/
│ └── Dockerfile # Path: apps/web/Dockerfile
└── packages/

Build context is the repository root, so your Dockerfile can access all files.

Updating Configuration

To change deployment settings:

  1. Go to the deployment detail
  2. Click Settings
  3. Update fields
  4. Save changes

Changes take effect on the next deploy.

Deleting Deployments

  1. Go to the deployment
  2. Click Delete
  3. Confirm deletion

This:

  • Stops the running container
  • Removes the deployment record
  • Does NOT delete Git repository