Server-side plugin to support automation of git pull via a webhook.
To load this plugin, add the following to the extras block in your
config.php:
'extras' => [
// ...
'remote-deploy' => [
'secret-token' => 'some-preshared-random-string',
],
// ...
],
secret-token - The secret token used to authenticate requeststoken-header - Optionally set to change the header, defaults to "X-Deploy-Token"The secret-token is required and is a shared secret to authorize the webhook.
By default X-Deploy-Token is used as the header to check against, but this can be changed to any header name.
N/A
To make use of this plugin, add a webhook in your github actions, gitlab-ci, or other CI/CD pipeline
to perform a web call to /deploy with the defined preshared secret token.
For example with Gitlab:
.gitlab-ci.yml in root of your project:
stages:
- deploy
deploy_to_server:
stage: deploy
tags:
- docker
image: curlimages/curl:latest
script:
- |
curl -X POST \
-H "X-Deploy-Token: some-preshared-random-string" \
https://your-site.tld/deploy
only:
- main
N/A