Deploy a GitHub branch with a push webhook
Connect a repository, configure checkout and push delivery, and use the recorded commit to check which revision is running.
Set the repository used at startup
Choose Connect GitHub when creating a deployment, or open Deploy in an existing one. Use a branch containing a runnable project, including its dependency manifest and entry file. Every plan, including Spark, can deploy a public or private GitHub repository that fits the disk limit. For a private repository, save a read credential in GIT_TOKEN.
In Variables, configure the checkout using the repository’s HTTPS clone URL and exact branch name. Substitute your own values below. For a private repository, put its read credential in GIT_TOKEN. Leave credentials out of the URL.
GIT_REPO=https://github.com/OWNER/REPOSITORY.git
GIT_BRANCH=main
AUTO_UPDATE=1Save the settings. Back up any edits made only through Files before switching sources. On restart the worker fetches the branch, so make future source edits in the repository.
Register the signed push notification
- In Deploy, enter
OWNER/REPOSITORYand the same branch as the checkout. Select Connetti GitHub. - Copy the generated webhook URL and the secret shown with it. In the GitHub repository, go to Settings → Webhooks → Add webhook.
- Paste the URL, choose
application/json, enter the generated secret, and select push events. Save the webhook. GitHub’s initial ping checks delivery to the host.
The signing secret authenticates GitHub’s incoming message. The checkout credential authorizes reading private code. Each belongs in its own field. Reconnecting the repository creates a replacement URL and secret. Update the GitHub webhook to match.
Match the revision to a visible result
Change a harmless observable detail such as the title of a test page. Push to the connected branch and record the commit ID. In Deploy, inspect Recent deploys and compare the short commit to your push. A queued event means the hook arrived. Wait for its outcome, then test the changed behavior over HTTPS or through the bot provider.
A push to a different branch is skipped. When an event arrives but the revision fails, check the configured checkout URL and branch, then inspect Console for a fetch, build or startup error. For a static site, check the serving release too. A failed candidate leaves the active release available.
Recover from a failed change
Usa Deploy latest to retry a connected branch once the previous deploy finishes and the cooldown expires. If the code is faulty, revert it in Git and deploy that new commit. For a published frontend, restore the previous release while preparing the source fix. Keep the last working commit ID with your deployment notes.