Deploy site
Deploys a site, remember that a deploy will not be done if there is no repository installed.
POST api/servers/{server}/sites/{id}/deploy
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
scheduled | datetime | optional | A date in the following format: 2023-01-01 10:00 in your own timezone to schedule a deployment in the future |
variables | object | optional | Allows you to add variables to your deploy script |
Example request:
curl -X POST "https://ploi.io/api/servers/{server}/sites/{id}/deploy" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
Example request with variables:
curl -X POST "https://ploi.io/api/servers/{server}/sites/{id}/deploy" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
--data '{
"variables": {
"branch": "main"
}
}'
In the above example you'd be able to grab the variable in your deploy script like so:
cd /home/ploi/examplehosting.com
echo $BRANCH