Fluxme.io
FluxCloud Advanced Deployment

Deploy with Git (CI/CD & Auto-Deploy)

Auto-deploy from GitHub/GitLab/Bitbucket — webhooks, polling, zero-downtime updates, rollback, and CI/CD integration.

12 min read
gitcicdauto-deploywebhook

Deploy with Git: CI/CD & Auto-Deploy

Flux's Deploy with Git feature enables automatic deployments directly from your Git repository. Push code to GitHub, GitLab, or Bitbucket, and Flux automatically detects changes, builds your application, and deploys it — with zero-downtime updates and automatic rollback on failures. This is the closest experience to platforms like Vercel or Netlify, but running on decentralized infrastructure.

How It Works

  1. 1

    Connect your repository

    Point Flux to your Git repository URL. Flux supports public and private repos (with token authentication).

  2. 2

    Auto-detect application stack

    Flux automatically detects your project type (Node.js, Python, Go, etc.) and configures the build pipeline accordingly.

  3. 3

    Trigger deployments

    Choose between webhook mode (instant deploy on push) or polling mode (Flux checks for changes at regular intervals).

  4. 4

    Zero-downtime updates

    New versions are deployed alongside the running version. Traffic switches only after the new version passes health checks.

  5. 5

    Automatic rollback

    If the new deployment fails health checks, Flux automatically rolls back to the previous working version.

Configuration via Environment Variables

VariableRequiredDescription
GIT_REPO_URLYesFull URL to your Git repository (e.g., https://github.com/user/repo.git)
APP_PORTYesPort your application listens on (e.g., 3000)
WEBHOOK_SECRETNoSecret for webhook verification (recommended for production)
GIT_TOKENNoPersonal access token for private repositories
GIT_USERNAMENoUsername for private repository authentication
POLLING_INTERVALNoInterval in seconds to check for changes (polling mode, default: 300)

Webhook Mode vs Polling Mode

FeatureWebhook ModePolling Mode
TriggerGit push event via webhookFlux checks repo at interval
SpeedInstant on pushDelay up to POLLING_INTERVAL seconds
SetupRequires webhook config in Git providerNo external config needed
ReliabilityDepends on webhook deliveryAlways works, even behind firewalls
Best forProduction with fast iterationSimple setups, private networks

Setting Up Webhooks

For GitHub: go to your repository Settings > Webhooks > Add webhook. Set the Payload URL to your Flux app's webhook endpoint, Content type to application/json, and the Secret to your WEBHOOK_SECRET. Select "Just the push event." For GitLab: Settings > Webhooks with similar configuration.

CI/CD Integration Examples

GitHub Actions — Build, test, then trigger Flux deploy

name: Deploy to Flux
on:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm test

  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build and push Docker image
        run: |
          docker build -t ${{ secrets.DOCKER_USER }}/myapp:latest .
          echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
          docker push ${{ secrets.DOCKER_USER }}/myapp:latest

Pricing

The Basic plan (1 app) is free and auto-renews. Additional apps via Deploy with Git cost $0.99/month per app. Standard Flux resource costs (CPU, RAM, storage) apply on top.

Deploy with Git is ideal for web applications, APIs, and microservices that are actively developed. For static Docker images that rarely change, a standard Flux deployment (manual image push) is simpler and cheaper.