Git Deploy
Connect any Git repository and deploy automatically on every push. sh0 handles cloning, building, and deploying your application with zero configuration.
Connecting a Repository
To deploy from Git, navigate to your stack in the sh0 dashboard and select New App → Git Repository. You can connect a repository by entering its URL or by linking your Git provider account for private repository access.
For public repositories, paste the HTTPS clone URL directly. For private repositories, you will need to connect your Git provider account or add an SSH key under Settings → SSH Keys.
https://github.com/your-org/your-app.gitSupported Providers
sh0 works with any Git provider that supports webhooks and SSH/HTTPS cloning:
- GitHub -- OAuth integration for one-click repository linking
- GitLab -- Self-hosted and GitLab.com supported
- Bitbucket -- Cloud and Server editions
- Gitea / Forgejo -- Self-hosted Git forges
- Any Git server -- Any repository accessible via SSH or HTTPS
Webhook Configuration
Webhooks enable push-to-deploy. When you push code to your repository, your Git provider sends a notification to sh0, which triggers a new build and deployment.
If you connected your Git provider via OAuth, webhooks are configured automatically. For manual setup, add a webhook in your repository settings with the following URL:
https://your-sh0-server.com:9000/api/hooks/git/{app_id}Configure the webhook to trigger on push events. sh0 generates a webhook secret for each app, which you can find under App Settings → Git → Webhook Secret. Add this secret to your Git provider to verify incoming payloads.
Branch Selection
By default, sh0 deploys from the main branch. You can change the deploy branch in your app settings to deploy from any branch in your repository.
Common configurations include:
- Production: Deploy from
mainorproduction - Staging: Deploy from
developorstaging - Feature branches: Use Preview Environments for automatic PR deployments
Build Settings
sh0 automatically detects your application stack and configures the build pipeline accordingly. You can also override these settings manually.
Dockerfile Auto-Detection
If your repository contains a Dockerfile, sh0 uses it automatically. You can also specify a custom Dockerfile path and build context:
dockerfile: ./deploy/Dockerfile
context: .
build_args:
NODE_ENV: production
API_URL: https://api.example.comsh0 supports multi-stage builds, build arguments, and custom build contexts. The build runs on your server, so large images do not incur transfer costs.
Buildpacks
If your repository does not include a Dockerfile, sh0 analyzes your code and generates an optimized Dockerfile automatically. It detects over 15 frameworks and languages:
- Node.js: Next.js, Nuxt, SvelteKit, Remix, Express, Fastify
- Python: Django, Flask, FastAPI
- Go: Standard Go modules
- Rust: Cargo-based projects
- PHP: Laravel, Symfony
- Ruby: Rails, Sinatra
- Static sites: HTML, Astro, Hugo, Jekyll
Deploy on Push
With webhooks configured, every push to your deploy branch automatically triggers a new deployment. The workflow is:
- You push code to the configured branch
- Your Git provider sends a webhook to sh0
- sh0 pulls the latest code from your repository
- The Docker image is built from your Dockerfile (or auto-generated one)
- A new container is deployed using blue-green deployment
- Traffic is switched to the new container once health checks pass
You can also disable automatic deploys and trigger them manually from the dashboard or via the API:
curl -X POST https://your-sh0-server.com:9000/api/apps/{app_id}/deploy \
-H "Authorization: Bearer YOUR_TOKEN"Viewing Build Logs
Every deployment generates a full build log that you can stream in real time from the dashboard. Build logs include:
- Git clone and checkout output
- Docker image build steps (each layer)
- Container startup and health check results
- Traffic switch confirmation
Build logs are stored for every deployment and can be accessed from the Deployments tab at any time. If a build fails, sh0 keeps the previous version running and marks the deployment as failed with a detailed error message.