Platforms
Where Vercel, Netlify, and GitHub Actions hand out the deploy hook, and the request options each one needs.
Vercel
Create a deploy hook under Settings → Git → Deploy Hooks of your project, as described in Vercel's deploy hooks guide, and use its URL as the deployUrl. The URL needs no token.
Netlify
Create a build hook as described in Netlify's build hooks guide, and use its URL as the deployUrl. The URL needs no token.
GitHub Actions
A GitHub Actions workflow starts on a repository_dispatch event. Add it to the triggers of the workflow that deploys your site:
.github/workflows/deploy.yml
on:
repository_dispatch:
types: [deploy]
The workflow file has to be on the repository's default branch; on any other branch, GitHub accepts the request and starts nothing.
GitHub's API needs a token, a user agent, and a JSON body, so send them through requestOptions. A fine-grained personal access token needs write access to the repository's Contents:
site/config/config.php
return [
'johannschopplich.deploy-trigger' => [
'deployUrl' => 'https://api.github.com/repos/<owner>/<repo>/dispatches',
'requestOptions' => [
'agent' => 'kirby-deploy-trigger',
'headers' => [
'Accept' => 'application/vnd.github+json',
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json'
],
'data' => json_encode(['event_type' => 'deploy']) // matches the workflow's types
]
]
];