Have you connected a repository? Then your website can update itself after every push. No button, no FTP. In our own test a change was live within 3 seconds of git push.
How do you set up the webhook?
- In Invoker Link, open the GitHub tab and click Update automatically next to your repository.
- Copy the Payload URL.
- Click Open GitHub. You land on Settings → Webhooks → Add webhook.
- Fill in:
- Payload URL: the copied URL
- Content type:
application/json - Which events: Just the push event
- Click Add webhook.
GitHub immediately sends a test message ("ping"). Under Recent Deliveries it should show a green tick.
Testing
git commit -am "Test: automatic deploy"
git push
Refresh your website. The change is there within seconds.
What exactly does the webhook do?
On every push:
- the server fetches the latest commits,
- it places the files of the chosen branch in the chosen location.
If you push to a different branch than the connected one, nothing changes on your website.
Good to know
- Files you delete from the repository stay on the website. A deploy only writes what's in the repository. Clean up old files yourself.
- Treat the webhook URL like a password. Anyone who knows the URL can trigger a deploy. That only publishes what's already in your repository, but don't share the URL.
- Changes made on the server are lost at the next deploy. If you edit a deployed file directly on the server (via FTP or the assistant), the next push overwrites it. Work in the repository.
Not working?
Look in GitHub under Settings → Webhooks → Recent Deliveries:
| What you see | What it means |
|---|---|
| No deliveries | The webhook isn't set to the push event, or nothing has been pushed yet. |
| Red cross, 404 | The URL wasn't copied correctly, or the connection was removed. |
| Green tick, site not updated | You pushed to a different branch than the connected one. |