---
search:
  tags:
    - sites
    - POST
seo:
  description: >-
    Queues a deploy of a site that is built from a GitHub repository (PUT…
    Reference for the POST /v1/sites/{site}/deploys endpoint in the pols.so API.
sidebar:
  label: Build and publish a site from its repository
  badge: POST
title: Build and publish a site from its repository
type: openapi-operation
---
Queues a deploy of a site that is built from a GitHub repository
(`PUT /v1/sites/{site}/source`): pols fetches the commit into a
new build sandbox of the org, runs the source's install and build
commands there as the sandbox user, publishes the output
directory as the site's new live version and deletes the sandbox.
Without a body it builds the head of the source's branch. The
build sandbox is billed as sandbox time and has the source's size,
its build variables, its vault entries as environment variables and
`CI=true`; it gets the public internet. An org builds one deploy at
a time, so deploys wait in the queue (`queued`); a newer deploy of
the same site and branch supersedes a queued one. The build stops
after the source's timeout. A build that writes the value of one of
its vault entries into the files to publish fails. Deploys count
against the org's publishes (30 an hour, 429 `rate_limited`); an
org without credit cannot deploy (402 `insufficient_credit`), nor
one that needs a subscription and has none (402
`subscription_required`).

`POST /v1/sites/{site}/deploys`
