Sites from GitHub
Import a GitHub repository as a site that pols builds and deploys on every push, as static files or as a running server app, with a dependency cache between deploys.
A site can be built from a GitHub repository: pols fetches a commit into a build sandbox of your org, runs the project’s install and build commands there, and publishes the result as the site’s new live version. Pushes to the site’s branch deploy it again by themselves.
pols sites import acme/website # a new private site, and its first deploy
pols deploys log website --follow # watch the build
pols deploys start website # deploy the branch's head again
pols deploys ls website
Connecting GitHub
pols reads repositories through the pols.so GitHub App. An owner or admin of your org installs it on a GitHub account or organization, with the repositories it may read (contents and metadata, read only), and connects it to the org on the GitHub page of the account pages. An installation belongs to one org. Disconnecting it keeps the sites built from it and their live versions; their sources are marked disconnected.
GET /v1/github/repositories (MCP github_repositories) lists the repositories the org’s installations let pols read.
Importing a repository
pols sites import REPO (MCP site_import), or Import from GitHub under Sites on the account pages, makes a new private site from owner/name and queues its first deploy of the repository’s default branch. Without --name, the site is named after the repository, with four random characters added if that name is taken.
The build settings are detected from the project’s files, with no configuration:
- the package manager from the lockfile (npm, pnpm, Yarn or Bun, at its
packageManagerversion); - the framework, with its install, build and start commands, output directory and port;
- the Node.js version from
.node-version, else.nvmrc, else the newest of 24, 22, 20 and 18 thatengines.nodeinpackage.jsonallows. The build sandbox has Node.js 24; another version is installed from nodejs.org, checked against its checksums, before the install.
Static sites are recognised for Vite and other single-page apps, Astro, Next.js with output: 'export', SvelteKit with adapter-static, Nuxt with a generate script, React Router with ssr: false, Gatsby, Docusaurus, VitePress, Eleventy, Create React App, Vue CLI, MkDocs, Hugo, and a plain site (an index.html and no package.json, published as it is). Projects that need a server run as server apps.
On the account pages, a site’s Settings change what was detected: the branch, the project’s directory in the repository, the install and build commands, the output directory, a framework preset, build variables and vault entries, the build sandbox’s size (small, default or large; default small), the build’s timeout (60 to 1,800 seconds, default 900) and whether pushes deploy it. Over the API, these are the site’s source, PUT /v1/sites/{site}/source.
Deploys
A deploy builds one commit:
- pols makes a build sandbox of your org from the default template, at the source’s size, with its build variables, its vault entries,
CI=trueand access to the public internet. - It fetches the commit with a read-only token for that repository alone, which it revokes before anything of the repository runs. Submodules are fetched without it, so only public ones work.
- It runs the install and build commands as the sandbox user in the project’s directory.
- It publishes the output directory as the site’s new live version, refusing it if a file holds the value of one of the build’s vault entries, and keeps a screenshot of the front page.
- It deletes the build sandbox.
A push to the site’s branch queues a deploy of the pushed commit. pols deploys start SITE (MCP site_deploy, POST /v1/sites/{site}/deploys), or Deploy on the account pages, deploys the branch’s head, or a branch or commit you name over the API. A newer deploy of the same site and branch replaces one that is still queued. Your org builds one deploy at a time; the others wait as queued.
pols deploys ls SITE(MCPsite_deploys) lists the site’s deploys, newest first; a site keeps its newest 100.pols deploys log SITE [DEPLOY](MCPsite_deploy_log) prints a deploy’s build log, at most 2 MiB, with vault values and common token formats redacted.--followprints it until the deploy is over and fails when it did not get ready.- Cancel on the account pages stops a queued or building deploy; the source’s timeout fails one.
- Each deploy’s commit gets a GitHub deployment and a
pols.socommit status that link to the deploy, if the installation has accepted those permissions.
Deploys count against your org’s publishes (30 an hour, see limits) and need credit. Build sandboxes are billed as sandbox time while they run, but do not count against your sandbox quotas and are not listed among your sandboxes.
Dependency cache
pols keeps each site’s package-manager stores (npm, pnpm, Yarn, Bun and Corepack) between deploys. A build restores them before the install, and after an install from scratch that succeeded, saves them as the site’s cache entry. The deploy log says which happened.
- The entry is used only when nothing it depends on changed: the lockfiles, the
packageManagerfields, the install command and the Node.js and npm versions. Any change installs from scratch. Without a lockfile, the cache is off. - Entries belong to one site and are never shared between sites or orgs.
- A restore that fails, or an install that fails on a restored store, drops the entry and installs from scratch, so the cache never fails a deploy. An install refused because the lockfile is out of date with
package.jsonstill fails, and says what to do. - An entry unused for 30 days is deleted, and so are a site’s entries when the site is deleted. When the cache is full, the least recently used entries go first.
Server apps
A project that needs a server is built as a server app, which pols runs like Vercel or Render: SvelteKit with adapter-node or a hosting platform’s adapter, Next.js, Nuxt, Remix and React Router, Astro with @astrojs/node, Express, Fastify, Hono, Koa, NestJS and other Node.js servers, and a package.json with a start script. Failing those, a project with a Dockerfile is built with docker build and run with docker run. A project pols does not recognise needs an output directory, or a start command to run as a server app.
- The deploy builds in a sandbox that then runs the app: its start command in the project’s directory, on
port(1024 to 65535, default 3000), withPORT,HOST=0.0.0.0,HOSTNAMEand, unless the site’s variables set it,NODE_ENV=production. The site’s variables and vault entries reach the app without being on a command line or in a log. - The deploy goes live once the app answers HTTP on its port, within two minutes; otherwise it fails with the end of the app’s log.
- The version that was live keeps serving for 30 seconds, then stops and is kept to roll back to. Only the newest version besides the live one keeps its sandbox.
- Requests go to the app as they come, every method and WebSockets too, after the site’s access check. An app whose sandbox is not running answers
503. - App sandboxes are listed among your sandboxes with purpose
app. They never go to standby, have no time to live, do not count against your sandbox quotas, and are billed as sandbox time. The size limits of static versions do not apply: the app has its sandbox’s disk. GET /v1/sites/{site}/appshows the app’s sandbox and status,GET /v1/sites/{site}/app/logs?lines=Nits log (at most 2,000 lines, vault values redacted), andPOST /v1/sites/{site}/app/restartrestarts it.
A server app that needs to keep data across deploys gets a database.