Опубликовать сайт
publish_sitePublish a static site to Layero — from here, with no terminal.
Takes ANY ready static bundle, so it is the answer to "deploy my site" when
the project has no connected repository. Requirements — `index.html` at
the root, at most 200 files, 8 MB in total, 2 MB per file. Binary files
(images, fonts) must come with `encoding="base64"`; sent as text they are
silently corrupted.
Do NOT use it for a project with a connected repository (`site_status`
shows one): the next git push would overwrite what you published.
Publishing without a Layero account is not possible from here — the
server requires sign-in. For that case there is the CLI:
`npx layero@latest deploy --claim` deploys first and lets the person
claim the site later. An empty project for a future publish is created
with `project_create`.
A project that still needs a build step (Vite, Next, Astro — anything
where the answer is `npm run build`) does NOT go here: publish its build
output, or tell the user to run `npx layero@latest deploy`, which builds
on our side.
Send the ACTUAL file contents: the server does not remember the bundle
between calls. If the user edited the text after generation, pass the
current versions, or what gets published is what used to be there.
Pass `project` (the id of an existing project) when republishing the
same site; without it the platform finds a project with that name or
creates a new one.
Returns as soon as the build finishes, or after ~40s with `status`
`building` and the `deploy_id` — the build keeps going on its own. Never
call this tool a second time to "retry" a build that is still running:
that starts a SECOND build. Follow `next_action`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | The whole site, with `index.html` in the root. Paths are relative (`assets/app.css`). Binary files go with `encoding="base64"`. At most 200 files, 8 MB in total, 2 MB per file. | |
| project | No | id of an existing project — to publish the same site again. Without it the platform looks the project up by name or creates a new one. | |
| project_name | Yes | Project slug — lowercase Latin letters, digits and hyphens. It becomes part of the site address. If the project already exists, pass `project` as well, otherwise the platform creates a new one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| bytes | Yes | ||
| error | No | ||
| files | Yes | ||
| status | Yes | ||
| deploy_id | Yes | ||
| project_id | Yes | ||
| next_action | Yes | ||
| project_slug | Yes | ||
| created_project | Yes |