Deploy site

Deploy your site using the configured deploy script.


POST/api/servers/{server}/sites/{id}/deploy

Deploy site

This endpoint triggers a deployment for your site. A deployment will not be executed if there is no repository installed.

Optional parameters

  • Name
    scheduled
    Type
    datetime
    Description

    Schedule a deployment for a future time. Format: 2023-01-01 10:00 in your timezone.

  • Name
    variables
    Type
    object
    Description

    Variables to pass to your deploy script.

Using variables in your deploy script

Variables passed via the API are available as environment variables in your deploy script (uppercased):

cd /home/ploi/examplehosting.com

echo $BRANCH

Request

POST
/api/servers/{server}/sites/{id}/deploy
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"

With variables (cURL)

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" \
  -d '{
    "variables": {
      "branch": "main"
    }
  }'

Response

{
  "message": "Deployment has been started"
}