{"slug":"static-sites-git","title":"Static Sites: Git Deployments","description":"Deploy your static site automatically from a GitHub, GitLab, or Bitbucket repository. Every push to your configured branch triggers a new build and deployment.","section":"Features","url":"https://docs.danubedata.ro/static-sites-git","markdown_url":"https://docs.danubedata.ro/static-sites-git.md","breadcrumbs":[{"title":"Features","slug":null},{"title":"Static Sites","slug":"static-sites"},{"title":"Git Deployments","slug":"static-sites-git"}],"headings":[{"level":1,"title":"Static Sites: Git Deployments","id":"static-sites-git-deployments"},{"level":2,"title":"Prerequisites","id":"prerequisites"},{"level":2,"title":"Supported providers","id":"supported-providers"},{"level":2,"title":"Repository configuration","id":"repository-configuration"},{"level":2,"title":"Private repositories","id":"private-repositories"},{"level":3,"title":"SSH key","id":"ssh-key"},{"level":3,"title":"Access token","id":"access-token"},{"level":2,"title":"Setting up webhooks","id":"setting-up-webhooks"},{"level":3,"title":"Step 1: Get webhook details","id":"step-1-get-webhook-details"},{"level":3,"title":"Step 2: Add webhook to your provider","id":"step-2-add-webhook-to-your-provider"},{"level":4,"title":"GitHub","id":"github"},{"level":4,"title":"GitLab","id":"gitlab"},{"level":4,"title":"Bitbucket","id":"bitbucket"},{"level":3,"title":"Webhook verification","id":"webhook-verification"},{"level":2,"title":"Auto-deploy","id":"auto-deploy"},{"level":3,"title":"Enabling auto-deploy","id":"enabling-auto-deploy"},{"level":3,"title":"Branch filtering","id":"branch-filtering"},{"level":2,"title":"Manual builds from Git","id":"manual-builds-from-git"},{"level":2,"title":"Build details","id":"build-details"},{"level":2,"title":"Troubleshooting","id":"troubleshooting"},{"level":3,"title":"Webhook not triggering builds","id":"webhook-not-triggering-builds"},{"level":3,"title":"Build fails with \"clone failed\"","id":"build-fails-with-clone-failed"},{"level":3,"title":"Build succeeds but site shows old content","id":"build-succeeds-but-site-shows-old-content"},{"level":3,"title":"Webhook shows 401/403 errors","id":"webhook-shows-401403-errors"},{"level":2,"title":"Next steps","id":"next-steps"}],"format":"markdown","word_count":777,"content":"# Static Sites: Git Deployments\n\nDeploy your static site automatically from a GitHub, GitLab, or Bitbucket repository. Every push to your configured branch triggers a new build and deployment.\n\n## Prerequisites\n\n- A static site with **Git Repository** as the deployment method\n- A Git repository hosted on GitHub, GitLab, or Bitbucket\n\n## Supported providers\n\n| Provider | Repository URL format |\n|----------|----------------------|\n| **GitHub** | `https://github.com/username/repo` |\n| **GitLab** | `https://gitlab.com/username/repo` |\n| **Bitbucket** | `https://bitbucket.org/username/repo` |\n\n## Repository configuration\n\nWhen creating or editing a static site with Git deployment, configure:\n\n- **Repository URL** — The HTTPS URL of your repository\n- **Branch** — The branch to deploy from (defaults to `main`)\n- **Publish directory** — The folder containing your built files (e.g., `dist`, `build`, `public`, or `/` for root)\n\n## Private repositories\n\nFor private repositories, select an authentication method:\n\n### SSH key\n\n1. Select **SSH Key** as the authentication type\n2. Paste your deploy key (private key)\n3. Add the corresponding public key as a deploy key in your repository settings\n\n### Access token\n\n1. Select **Access Token** as the authentication type\n2. Enter a personal access token with read access to the repository\n\n**GitHub:** Generate a fine-grained token with `Contents: Read` permission at **Settings > Developer settings > Personal access tokens**.\n\n**GitLab:** Generate a project access token with `read_repository` scope at **Settings > Access Tokens**.\n\n**Bitbucket:** Generate an app password with `Repositories: Read` permission at **Personal settings > App passwords**.\n\n## Setting up webhooks\n\nWebhooks enable automatic deployments when you push to your repository.\n\n### Step 1: Get webhook details\n\n1. Navigate to your site detail page\n2. Find the **Git Configuration** section\n3. Copy the **Webhook URL** and **Webhook Secret**\n\n### Step 2: Add webhook to your provider\n\n#### GitHub\n\n1. Go to your repository **Settings > Webhooks**\n2. Click **Add webhook**\n3. **Payload URL** — Paste the webhook URL\n4. **Content type** — `application/json`\n5. **Secret** — Paste the webhook secret\n6. **Events** — Select **Just the push event**\n7. Click **Add webhook**\n\n#### GitLab\n\n1. Go to your project **Settings > Webhooks**\n2. **URL** — Paste the webhook URL\n3. **Secret token** — Paste the webhook secret\n4. **Trigger** — Check **Push events**\n5. Click **Add webhook**\n\n#### Bitbucket\n\n1. Go to your repository **Settings > Webhooks**\n2. Click **Add webhook**\n3. **Title** — `DanubeData Deploy`\n4. **URL** — Paste the webhook URL\n5. **Triggers** — Select **Repository push**\n6. Click **Save**\n\n> **Note**: For Bitbucket, the webhook secret is verified via the `X-Hub-Signature` header using HMAC-SHA256.\n\n### Webhook verification\n\nEach provider uses a different signature mechanism:\n\n| Provider | Header | Method |\n|----------|--------|--------|\n| **GitHub** | `X-Hub-Signature-256` | HMAC-SHA256 |\n| **GitLab** | `X-Gitlab-Token` | Token comparison |\n| **Bitbucket** | `X-Hub-Signature` | HMAC-SHA256 |\n\n## Auto-deploy\n\nWhen auto-deploy is enabled, pushes to the configured branch automatically trigger new builds.\n\n### Enabling auto-deploy\n\n1. Navigate to the site detail page\n2. Click **Edit**\n3. Enable **Auto-deploy on push**\n4. Click **Save**\n\n### Branch filtering\n\nOnly pushes to the configured branch trigger builds. Pushes to other branches are ignored. To change the deploy branch:\n\n1. Navigate to the site detail page\n2. Click **Edit**\n3. Update the **Branch** field\n4. Click **Save**\n\n## Manual builds from Git\n\nYou can trigger a build manually without pushing to the repository:\n\n1. Navigate to the site detail page\n2. Click **Redeploy**\n\nThis clones the latest commit from the configured branch and starts a new build.\n\n## Build details\n\nEach Git-triggered build records:\n\n- **Commit SHA** — The exact commit that triggered the build\n- **Commit message** — The commit message\n- **Commit author** — Who made the commit\n- **Branch** — The branch that was pushed to\n- **Trigger type** — `webhook` for automatic builds, `manual` for manual rebuilds\n\n## Troubleshooting\n\n### Webhook not triggering builds\n\n- Verify the webhook URL and secret match the values shown in the dashboard\n- Check that the webhook is configured for push events only\n- Ensure **Auto-deploy on push** is enabled in the site settings\n- Check the webhook delivery logs in your Git provider for HTTP response codes\n- Ensure the push is to the configured branch (other branches are ignored)\n\n### Build fails with \"clone failed\"\n\n- Verify the repository URL is correct and accessible\n- For private repos, check that the SSH key or access token has read permissions\n- Ensure the configured branch exists in the repository\n\n### Build succeeds but site shows old content\n\n- Verify the **Publish directory** matches your build output folder\n- Check that the built files include an `index.html` at the root of the publish directory\n- If your build tool outputs to a different directory, update the publish directory setting\n\n### Webhook shows 401/403 errors\n\n- Regenerate the webhook secret from the site settings\n- Update the webhook configuration in your Git provider with the new secret\n- Ensure the webhook URL has not been modified\n\n## Next steps\n\n- [Static Sites overview](https://docs.danubedata.ro/static-sites) — Full feature reference\n- [Static Sites quick start](https://docs.danubedata.ro/static-sites-quickstart) — Deploy your first site\n- [Custom domains](https://docs.danubedata.ro/static-sites-domains) — DNS verification and TLS setup\n\n---\n\n**Questions?** Contact support at support@danubedata.ro\n","prev":{"title":"Custom Domains","slug":"static-sites-domains","url":"https://docs.danubedata.ro/static-sites-domains","markdown_url":"https://docs.danubedata.ro/static-sites-domains.md","json_url":"https://docs.danubedata.ro/static-sites-domains.json"},"next":{"title":"Rapids","slug":"serverless-overview","url":"https://docs.danubedata.ro/serverless-overview","markdown_url":"https://docs.danubedata.ro/serverless-overview.md","json_url":"https://docs.danubedata.ro/serverless-overview.json"},"index_url":"https://docs.danubedata.ro/index.json"}