The deploy webhook URL is a great way to automate your deployments. Either via GitHub actions or another CI system, with the deploy webhook URL you can deploy whenever you want.
You can find the deploy webhook URL in your site, in the Repository tab, look for the Deploy webhook URL card. In there you can easily copy the deploy webhook URL or refresh the token, in case you think it got exposed or needs swapping.
The deploy URL requires a POST
or OPTIONS
method and the URL structure looks like this: https://ploi.io/webhooks/servers/1/sites/1/deploy?token=bVKlWN.....&direct=true
Additionally, you may pass in variables as query parameters or JSON body that'll be available inside your deploy script.
Example URL via query parameters:
https://ploi.io/webhooks/servers/1/sites/1/deploy?token=xOUr...&direct=true&variables[tag]=v1.0.0&variables[branch]=staging
Example URL with JSON body:
https://ploi.io/webhooks/servers/1/sites/1/deploy?token=xOUr...&direct=true
JSON body:
{
"variables": {
"tag": "v1.0.0"
"branch": "staging"
}
}
In both these examples, the variables $TAG
and $BRANCH
will be available inside your deploy script:
cd /home/ploi/ploi.io
echo $TAG
echo $BRANCH
Output:
v1.0.0
staging