Skip to content

Deploying from Git

Step-by-step guide to deploying applications directly from Git repositories

Deploy directly from your Git repository with automatic builds and deployments on every push. Sproobo supports GitHub.

ℹ️

Git deployments automatically build and deploy your application whenever you push to the configured branch.

Prerequisites

Before deploying from Git, ensure your repository has:

Repository Requirements

  • Dockerfile: Required for building the application
  • docker-compose.yml: Optional, for multi-container apps
  • .dockerignore: Recommended, to exclude unnecessary files
  • Application code: Your application source code

Connecting Your Repository

  1. 1

    Navigate to Deployments

    In your project dashboard, click on "Deployments" and then "Create Deployment".
  2. 2

    Choose Git Deployment

    Select "Deploy from Git" as your deployment source.
    Sproobo Git deployment option
    Select Deploy from Git as your deployment method.
  3. 3

    Connect Git Provider

    If you haven't already, connect your Git provider account:
    • Click "Connect GitHub" and authorize Sproobo to access your repositories
    • Authorize Sproobo to access your repositories
    • Grant necessary permissions for repository access and webhooks
    Sproobo Git provider authorization
    Authorize Sproobo to access your Git repositories.
  4. 4

    Select Repository

    Choose the repository you want to deploy from your connected accounts.
    Sproobo repository selection
    Select the repository you want to deploy.
  5. 5

    Configure Branch

    Select which branch to deploy from (typically "main" or "master").

    Branch Options

    • Main Branch: Production deployments from main/master
    • Preview Deployments: Deploy from feature branches for testing
    • Tag Deployments: Deploy specific versions using tags
    Sproobo branch selection
    Select the branch you want to deploy from.
  6. 6

    Configure Build Settings

    Configure how your application will be built:
    • Dockerfile Path: Location of your Dockerfile (default: "./Dockerfile")
    • Build Context: Build context directory
    • Build Arguments: Additional build arguments for Docker
    • Build Command: Optional custom build command
    Sproobo build configuration
    Configure build settings for your Docker build.
  7. 7

    Configure Deployment

    Set deployment-specific settings:
    • Deployment Name: A descriptive name for your deployment
    • Server: Select which server to deploy to
    • Port: Internal port your app will use
    • Environment Variables: Add any required environment variables
    • Health Check Path: Path for health check endpoint
    Sproobo deployment configuration
    Configure deployment settings including server, port, and environment variables.
  8. 8

    Review and Deploy

    Review your configuration and click "Deploy". Sproobo will:
    1. Clone your repository
    2. Build your Docker image
    3. Push the image to the registry
    4. Deploy to your server
    5. Set up HTTPS and routing
    6. Configure automatic deployments
    Sproobo Git deployment progress
    Watch as your application is built and deployed automatically.

Automatic Deployments

Once connected, Sproobo will automatically deploy on every push:

  1. 1

    Webhook Setup

    Sproobo automatically sets up webhooks in your repository to listen for pushes.
    GitHub webhook configuration
    Sproobo automatically configures webhooks in your repository.
  2. 2

    Automatic Build

    When you push to the configured branch, Sproobo will:
    • Detect the push event
    • Start a new build
    • Build your Docker image
    • Deploy to your server
    Sproobo automatic deployment trigger
    Every push to your branch triggers an automatic deployment.
  3. 3

    Deployment Status

    Track deployment status in the Sproobo dashboard:
    • Build progress and logs
    • Deployment status
    • Commit hash and author
    • Deployment duration
    Sproobo deployment status page
    Monitor deployment progress and status in real-time.

Dockerfile Best Practices

To ensure successful builds, follow these Dockerfile best practices:

Dockerfile Tips

  • Multi-stage builds: Use multi-stage builds to reduce image size
  • Layer caching: Order instructions from least to most frequently changed
  • Security: Don't run as root user, use non-root user
  • Health checks: Include HEALTHCHECK instruction
  • Minimize layers: Combine RUN commands to reduce layers

Environment Variables

Configure environment variables for your deployment:

  1. 1

    Add Environment Variables

    Go to Deployment → Settings → Environment Variables.
    Sproobo environment variables configuration
    Add environment variables for your deployment.
  2. 2

    Secure Variables

    Mark sensitive variables as "Secret" to encrypt them at rest.
    ⚠️

    Secret variables are encrypted and never shown in logs or UI. Use these for API keys, passwords, and tokens.

Manual Deployments

You can also trigger manual deployments:

  1. 1

    Redeploy

    Go to Deployment → Actions → Redeploy to manually trigger a deployment.
  2. 2

    Deploy Specific Commit

    Choose to deploy a specific commit or tag from the deployment history.
    Sproobo manual deployment trigger
    Manually trigger deployments from the Sproobo dashboard.

Next Steps

Now that your Git deployment is set up: