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 environmentgon release production # Explicit productiongon release --force # Skip deploy confirmationgon release --tag=v2.0.0 # Explicit taggon release --no-cache # Clean rebuildgon 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 togon 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
- Resolve next tag from GHCR (or use
--tag) - Run test suite (unless
--skip-tests) — aborts on failure - Build production Docker image
- Push to
ghcr.io/rozklad/gon-{project}:{tag} - Deploy to production server (with confirmation unless
--force) - Health check + post-deploy commands
Arguments & options
| Name | Description |
|---|---|
environment | Target 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, --tag | Image tag (auto-increments patch if omitted) |
--no-cache | Build without Docker cache |
--force | Skip deploy confirmation prompt |
--skip-tests | Skip test suite before deploy |
Example
$ gon release --forceReleasing 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