Deploy with Git (CI/CD & Auto-Deploy)
Auto-deploy from GitHub/GitLab/Bitbucket — webhooks, polling, zero-downtime updates, rollback, and CI/CD integration.
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
Connect your repository
Point Flux to your Git repository URL. Flux supports public and private repos (with token authentication).
- 2
Auto-detect application stack
Flux automatically detects your project type (Node.js, Python, Go, etc.) and configures the build pipeline accordingly.
- 3
Trigger deployments
Choose between webhook mode (instant deploy on push) or polling mode (Flux checks for changes at regular intervals).
- 4
Zero-downtime updates
New versions are deployed alongside the running version. Traffic switches only after the new version passes health checks.
- 5
Automatic rollback
If the new deployment fails health checks, Flux automatically rolls back to the previous working version.
Configuration via Environment Variables
| Variable | Required | Description |
|---|---|---|
| GIT_REPO_URL | Yes | Full URL to your Git repository (e.g., https://github.com/user/repo.git) |
| APP_PORT | Yes | Port your application listens on (e.g., 3000) |
| WEBHOOK_SECRET | No | Secret for webhook verification (recommended for production) |
| GIT_TOKEN | No | Personal access token for private repositories |
| GIT_USERNAME | No | Username for private repository authentication |
| POLLING_INTERVAL | No | Interval in seconds to check for changes (polling mode, default: 300) |
Webhook Mode vs Polling Mode
| Feature | Webhook Mode | Polling Mode |
|---|---|---|
| Trigger | Git push event via webhook | Flux checks repo at interval |
| Speed | Instant on push | Delay up to POLLING_INTERVAL seconds |
| Setup | Requires webhook config in Git provider | No external config needed |
| Reliability | Depends on webhook delivery | Always works, even behind firewalls |
| Best for | Production with fast iteration | Simple 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:latestPricing
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.
Sources & Further Reading
Other articles in FluxCloud Advanced Deployment
Docker Prerequisites & Best Practices for Flux
Install Docker, create optimized Dockerfiles, multi-stage builds, image registries, containerData volumes, and common mistakes.
Compose v4: Multi-Component Applications
Deploy up to 5 components with Flux Compose v4 — internal DNS, inter-component communication, ports, and environment variables.
Enterprise Deployments (Private Images, Secrets & Static IP)
Enterprise mode features — private Docker registries, secrets management, static IPs, node targeting, and pricing.
Flux-Orbit: Zero-Config Universal Deployment
Deploy any project without a Dockerfile — auto-detection for Node.js, Python, Rust, Go, Java, Bun, Ruby, and static sites.
Shared Databases & Auto-Replication
Deploy databases on Flux with persistent storage — MongoDB, PostgreSQL, Redis replication strategies and backup patterns.
Tiered Resources, Spec Builder & Cost Calculator
Basic/Super/BAMF resource tiers, Visual Spec Builder, Cost Calculator, pricing model, and cloud cost comparison.
App Troubleshooting & Post-Deployment Management
Diagnose deployment failures, domain issues, DB connection problems — plus updating specs, monitoring, and app lifecycle management.