Exporting a Builder site to GitHub (one-shot + auto-export-on-publish)
Once GitHub is connected (see "Connecting GitHub to your Turtini org"), every Builder site has a one-click export action that pushes the rendered HTML / CSS / assets to a GitHub repository you own. Module data — CRM, accounting, runbooks — stays in Turtini and is never written to the repo.
To export a site (one-shot):
1. Open Builder → Sites
2. Click the GitHub icon on the site card
3. The export modal opens with two flows:
• Not yet connected to GitHub → click Connect GitHub inline (the OAuth popup runs without leaving the modal); on success the form resumes
• Already connected → fill in the form
4. Repository name (auto-suggested as <orgSlug>-<siteSlug>) — accept or edit
5. Make repository private — checkbox (requires repo scope on the GitHub connection; if you only granted public_repo, you'll see an inline amber warning and can disconnect/reconnect to upgrade)
6. Click Export
What happens behind the scenes:
• If the repo doesn't exist, Turtini creates it (public or private per your choice). If a repo already exists with that name and Turtini doesn't have access, you'll see a clear "name in use" error.
• Turtini renders every page of the site to static HTML using the same block renderer the live site uses. Tailwind is pulled from the official CDN at runtime — no per-page compile step.
• A single atomic commit is force-pushed to main via the Git Trees API. Force-push handles concurrent dev-side edits without rewriting history (every export is a real commit with the previous tip as parent).
• Form blocks render <form action="https://api.turtini.com/v1/forms/submit"> — submissions land in your Turtini Form inbox exactly as if they came from the live Turtini-hosted site.
• Module-bound blocks (events lists, products, articles) render as "view on live site" placeholder cards in V1.
Auto-export on publish:
After the first export, the site card shows an "Auto-export on publish" checkbox. Toggle it on and Turtini fires an export every time you publish a page change in Builder. There's a 5-minute per-site debounce so a flurry of small edits collapses into one commit. Failures log to Settings → Integrations → integrationEvents but never block publish in the editor.
Re-exports go to the same repo on a new commit on top of main. If you've manually edited the repo on GitHub between exports, a force-push will overwrite those edits — Turtini is the source of truth in export mode. (For "GitHub is the source of truth" use pull-to-host instead — see "Hosting a static site from GitHub".)
Limits (per export):
• 500 files
• 50 MB total bundle
• 540s timeout
Where to find the repo: the site card shows a link to the GitHub repo once exported. The integration audit log at Settings → Integrations → GitHub shows every export with timestamp + commit SHA + actor.