Docs · how to

Deploy from GitHub on push

Connect a repository so every push to the default branch deploys alpha, with a check run that links to the phase log.

1. Install the denv GitHub App on the repository

From the console, Targets → GitHub → Install, or install the app directly from GitHub and pick the repositories. The app needs Contents read, Metadata read, and Checks write.

After installing, GitHub redirects back with an installation id. Link it:

curl -s -X POST $DENV_SERVER/v1/github/installations/<installation id>/link -H "Authorization: Bearer $DENV_API_KEY"
curl -s $DENV_SERVER/v1/github/installations -H "Authorization: Bearer $DENV_API_KEY"

3. Create the project from the repository

denv project create --kind rl-environment --source github:you/ops-world ops-world
curl -s -X POST $DENV_SERVER/v1/projects/ops-world/deploy-from-source -H "Authorization: Bearer $DENV_API_KEY"

deploy-from-source reads docker-compose.yaml from the default branch and deploys alpha. Change the branch or the file path:

curl -s -X POST $DENV_SERVER/v1/projects/ops-world/source -H "Authorization: Bearer $DENV_API_KEY" \
  -H 'Content-Type: application/json' -d '{"default_branch":"main","compose_path":"envs/ops/compose.yaml"}'

4. Push

Every push to the default branch deploys alpha from that commit. A check run named denv appears on the commit, moves to success or failure, and links to the deployment's phase log. The commit sha is recorded with the deployment.

Other branches deploy only when you ask: either an environment named after the branch already exists (feature/x becomes feature-x), or the project opts in:

curl -s -X POST $DENV_SERVER/v1/projects/ops-world/source -H "Authorization: Bearer $DENV_API_KEY" \
  -H 'Content-Type: application/json' -d '{"deploy_branches":true}'

What happens on a failed push

If the compose file is missing or refused at resolve, the check run fails with the reason and no deployment is created. If a later phase fails, the deployment is rolled_back to the previous healthy version and the check run says so.