Workspaces Docs

Deploy from Git

Connect a repository and every push to its branch becomes a release.

eutonomous git connect git@codebahn.net:you/app.git      # --branch main is the default

The command prints two things to add in the repository’s settings at your Git host:

  1. A deploy key, read-only. It is the public half of a key that was made inside your environment, so the platform holds no credential for your repository. A public repository connected by its https:// address needs no key.
  2. A webhook for push events (POST, JSON). Its address contains a secret and is shown once; run git connect again if you lose it.

On Codebahn both are under the repository’s Settings: Deploy keys and Webhooks (type Forgejo). Other hosts that send the usual push payload work the same way.

What a push does

The environment clones the branch, installs it and starts it next to the live release. It takes over once it answers, so visitors see no gap. A commit that does not start leaves the live release where it is, and the reason, with the app’s own output, is in eutonomous git status.

  • Pushes to other branches and tags are ignored.
  • A sleeping workspace is woken for the deploy.
  • A release from Git is a release like any other: eutonomous releases, eutonomous rollback and the Apps page show and handle it.
eutonomous git status        # the repository, and how the last deploy went
eutonomous git deploy        # deploy the branch as it is now, without a push
eutonomous git disconnect    # pushes stop deploying; the live release stays

The project needs what any deploy needs: a pixi.toml with a serve task that listens on $HOST and $PORT. Variables set with eutonomous env set apply to releases from Git too.

A preview for every branch

eutonomous git previews on       # off by default; or: eutonomous git connect <repo> --previews

With previews on, a push to any other branch gets a workspace of its own, named after the branch, and is deployed there. Later pushes to the branch update it. When the branch is deleted, its workspace and files are deleted too. eutonomous git status lists the previews with their addresses.

  • A preview is private: only you and the people you invite can open it.
  • Each preview is a workspace like any other. It counts towards the number your account may have, is billed while awake, and sleeps when idle. At most five exist per repository; when one cannot be created, eutonomous git status says why.
  • A private repository is read with the same deploy key: it is copied from the connected environment into the preview workspace, and stored nowhere else.
  • Switching previews on needs a key with the create permission.
  • Variables are not copied. Set a preview’s own with eutonomous env set --env <its id>.

Git or CI?

Both end in the same release. Deploying from Git needs nothing but the repository. A pipeline (Keys and CI) is the better fit when tests should pass before a deploy.