Skip to content
GitHub

Build the app from a Git repository and branch, or change how.

PUT
/api/v1/projects/{project}/environments/{environment}/apps/{app}/source
curl --request PUT \
--url https://example.com/api/v1/projects/example/environments/example/apps/example/source \
--header 'Content-Type: application/json' \
--data '{ "installationId": 1, "connection": "example", "repository": "acme/shop", "branch": "main", "strategy": "auto", "context": "apps/web", "dockerfile": "example", "imageRepository": "registry.example.com/acme/shop" }'

A change stops earlier builds from deploying themselves and builds the branch head again.

project
required
string

Project name

environment
required
string

Environment short name

app
required
string

App name

Media typeapplication/json
object
installationId

A GitHub App installation linked to this organization. Required unless connection is given.

integer format: int64
connection

A Git connection of this organization (its id), instead of an installation: GitLab, Gitea or a GitHub token.

string
repository
required
string
Example
acme/shop
branch
required
string
Example
main
strategy
string
Allowed values: auto dockerfile railpack
context

Build context inside the repository; the root when empty.

string
Example
apps/web
dockerfile

Dockerfile relative to the context; Dockerfile when unset.

string | null
imageRepository
required

Where builds push, without tag or digest.

string
Example
registry.example.com/acme/shop
Media typeapplication/json
object
installationId
required

The GitHub App installation; 0 when the source reads through a connection.

integer format: int64
repository
required
string
branch
required
string
strategy
required
string
Allowed values: auto dockerfile railpack
context
required
string
dockerfile
string | null
imageRepository
required
string
head

The last head read from GitHub.

string | null
syncOperation

The sync this change or request queued, if any.

string | null
provider
required

github (a personal or fine-grained token; the GitHub App has its installations), gitlab, or gitea (Gitea and Forgejo).

string
Allowed values: github gitlab gitea
connection

The Git connection the source reads through; none for a GitHub App installation.

string | null
Example
{
"strategy": "auto",
"provider": "github"
}
Media typeapplication/json

Problem Details body.

object
code
required

Stable machine-readable code, e.g. forbidden.

string
title
required

Short human readable title.

string
status
required

HTTP status.

integer format: int32
detail

Details, if safe to expose.

string | null
Example
{
"code": "forbidden"
}
Media typeapplication/json

Problem Details body.

object
code
required

Stable machine-readable code, e.g. forbidden.

string
title
required

Short human readable title.

string
status
required

HTTP status.

integer format: int32
detail

Details, if safe to expose.

string | null
Example
{
"code": "forbidden"
}
Media typeapplication/json

Problem Details body.

object
code
required

Stable machine-readable code, e.g. forbidden.

string
title
required

Short human readable title.

string
status
required

HTTP status.

integer format: int32
detail

Details, if safe to expose.

string | null
Example
{
"code": "forbidden"
}
Media typeapplication/json

Problem Details body.

object
code
required

Stable machine-readable code, e.g. forbidden.

string
title
required

Short human readable title.

string
status
required

HTTP status.

integer format: int32
detail

Details, if safe to expose.

string | null
Example
{
"code": "forbidden"
}