gon release

Build, push, and deploy in a single command. Combines gon build --push + gon deploy.

Usage

gon release # Test, build, push, deploy to default env (production)
gon release staging # Release to staging environment
gon release production # Explicit production
gon release --force # Skip deploy confirmation
gon release --tag=v2.0.0 # Explicit tag
gon release --no-cache # Clean rebuild
gon release --skip-tests # Deploy without running tests

Target environment

The optional environment argument routes the deploy step to the host registered for that environment in ~/.gon/servers.json. Without it, release targets the project's default_environment (which is production for projects registered with the original single-host workflow).

gon release # Default env (usually production)
gon release staging # Whatever staging.host points to
gon release staging --tag=v2.0.0 --force

To register a new environment (so this argument has somewhere to deploy), see gon server:add-project with the --env flag, or the multi-environment recipe.

Auto-increment

Without --tag, queries GHCR for the latest semver tag and increments the patch version:

v2.2.0 (latest on GHCR) v2.2.1 (new build)

If no versions exist yet, starts at v1.0.0.

What happens

  1. Resolve next tag from GHCR (or use --tag)
  2. Run test suite (unless --skip-tests) — aborts on failure
  3. Build production Docker image
  4. Push to ghcr.io/rozklad/gon-{project}:{tag}
  5. Deploy to production server (with confirmation unless --force)
  6. Health check + post-deploy commands

Arguments & options

NameDescription
environmentTarget environment (positional, optional). Defaults to the project's default_environment. Pass staging, production, or any custom env you registered via gon server:add-project --env=NAME.
-t, --tagImage tag (auto-increments patch if omitted)
--no-cacheBuild without Docker cache
--forceSkip deploy confirmation prompt
--skip-testsSkip test suite before deploy

Example

$ gon release --force
Releasing gon@v2.2.1
 
Building: ghcr.io/rozklad/gon-gon:v2.2.1
Building Docker image... OK (2m 15s)
Pushing to registry... OK (30s)
 
Deploying gon@v2.2.1 to yolo1...
Pull image
Recreate containers
Health check OK
Migrations + cache clear
 
Deployed gon@v2.2.1