apps

Connect this app to a workflow of yours or to a build of ours, and move it between the two: every field is taken from this call

put/instances/{instance_id}/apps/{name}/github

Request

  • Base URL: https://app.lathe.live/api/v1
  • URL: https://app.lathe.live/api/v1/instances/{instance_id}/apps/{name}/github
  • Auth: none declared

Path parameters

instance_idstring required
namestring required

Request body

repostring required

owner/name, as GitHub spells it. It must be a repository the Lathe app is installed on for this account.

workflowstring

The workflow file that builds and pushes the image, e.g. .github/workflows/ci.yml. Required for source="actions"; unused for source="lathe".

branchstring

The branch whose runs count; the repository's default branch when empty.

imagestring

The reference the workflow pushes to, e.g. ghcr.io/you/app:main. Empty keeps the one the app already runs. Each deploy resolves it to a digest and runs that, so what is running can be named and gone back to. source="actions" only: a build of ours goes to a registry of ours, and an image sent with source="lathe" is ignored rather than refused, so GET then PUT of the same body moves an app between the two ways of building without having to empty this field.

autoboolean

True: a green run deploys this app, and your workflow needs no step of ours. False: the runs are tracked and shown, and your own workflow calls the deploy endpoint.

sourcestring

"actions": your own workflow builds it, watched for a green run. "lathe": we build it - a commit becomes an image on a box of ours, no workflow and no registry of your own needed.

targetstring

The Dockerfile stage a build of ours stops at, e.g. "runtime" for FROM python:3.14-slim AS runtime. Empty builds the last stage in the file, which is what a single-stage Dockerfile and the usual builder-then-runtime pair want; name one when the last stage is not the one that should run. source="lathe" only.

build_envboolean

True: the app's own environment variables are given to the build as well as to the running container, which is what a front-end bundle and an install from a private package registry need. False: the build is given none of them, for an app whose variables are credentials a build has no use for - they would be written onto the build machine, and into the image config for any name the Dockerfile declares as an ARG. source="lathe" only.

check_commandstring

A command that must exit 0 inside the built image before it deploys - npm test, pytest -q, tsc --noEmit. Run in the image itself, with the app's variables, and with no access to the box it runs on. Empty: a green build deploys. A check that fails is a build that made an image and did not deploy; the build page has what it printed. source="lathe" only.

check_targetstring

The Dockerfile stage the check runs in, when it is not the one that deploys: a test stage that adds the test tooling to the image that ships. Built with the same variables, never pushed. Empty: the check runs in the image that deploys. source="lathe" only.

check_envobject nullable

Variables for the check and nothing else - not the build, not the running app: the URL of a database to run the tests against is what they are for. Names are letters, digits and underscores. Left out (null) keeps the ones already set, since their values are never read back; {} clears them. source="lathe" only.

pathsstring

Space-separated globs a push must touch for this app to be built at all, e.g. "apps/web/** packages/ui/**". Empty builds every push. What a monorepo needs: a push to one app does not rebuild the other three, and a README does not redeploy anything. A commit whose files cannot be compared is built, never skipped. source="lathe" only.

pr_buildsboolean

Build and check every pull request into the branch as well, from the repository itself (never a fork), and report it as a check run on the pull request; a pull request's build is never deployed. A push to the branch whose files are exactly those of a build that already passed - the merge of a pull request that was up to date with the branch - deploys that build's image instead of building it again. source="lathe" only.

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.