Back to Blog
team@tinypod.app

Git-Based Deployments: Push to Deploy for Self-Hosted Apps

Push code, trigger deployment. Git-based deployments bring the Vercel/Netlify experience to your self-hosted infrastructure.

gitdeploymentci-cddevops

The Goal


git push origin main → Your app is live with the new code.


Vercel and Netlify made this the standard developer experience. You can have it on self-hosted infrastructure too.


Approach 1: Git Hooks


The simplest method. A post-receive hook on the server builds and deploys.


Setup

1. Create a bare git repo on your server

2. Add a post-receive hook that:

  • Checks out the code
  • Builds the Docker image
  • Restarts the container

  • Pros

  • Zero dependencies (just git and Docker)
  • Instant (no CI queue)

  • Cons

  • Builds happen on your production server (uses CPU)
  • No build cache between deploys
  • Fragile if the build fails

  • Approach 2: CI/CD Pipeline


    Gitea Actions, Woodpecker CI, or GitHub Actions builds the image and pushes to a registry. The server pulls and deploys.


    Flow

    1. Push to Gitea/GitHub

    2. CI builds Docker image

    3. CI pushes image to registry

    4. CI triggers deployment (SSH or webhook)

    5. Server pulls new image and restarts container


    Pros

  • Builds don't affect production server
  • Full test suite runs before deploy
  • Build caching
  • Rollback = deploy previous image

  • Cons

  • More infrastructure (CI server, registry)
  • Slightly slower (CI queue + build + push + pull)

  • Approach 3: Coolify / CapRover


    Platform-as-a-Service tools that provide push-to-deploy out of the box.


    Coolify

  • Connect to GitHub/Gitea
  • Auto-detect framework (Dockerfile, Nixpacks, Buildpacks)
  • Build and deploy on push
  • Preview environments for PRs

  • CapRover

  • Git push to deploy
  • Dockerfile or pre-built image
  • Let's Encrypt SSL
  • Simple web dashboard

  • The TinyPod Approach


    TinyPod deploys from container images. Your CI pipeline builds the image, TinyPod runs it. This separation means:


  • Build anywhere (GitHub Actions, Gitea, local)
  • Deploy consistently (same image = same behavior)
  • Rollback instantly (previous image tag)

  • Recommendation


    For most self-hosters:

    1. Use GitHub/Gitea for code hosting

    2. Use GitHub Actions or Gitea Actions for CI

    3. Build and push Docker images to GHCR or Docker Hub

    4. Deploy to TinyPod


    Simple, reliable, and you get the push-to-deploy experience without running your own build infrastructure.