developis the only long-lived branch.- Staging and production both run tagged releases (
vX.Y.Z). A tag goes to staging first, then to production. - A hotfix is a branch created from the production tag, released as a patch version.
Every push to develop and every v*.*.* tag runs .github/workflows/helm-publish.yaml
(tests run first; nothing is published if they fail).
| Trigger | Docker image | Helm chart (oci://ghcr.io/ifrcgo) |
GitHub Release |
|---|---|---|---|
push develop |
ghcr.io/ifrcgo/go-api:develop.c<sha7> |
ifrcgo-helm:<X.Y.Z>-develop.c<sha7> |
no |
push tag vX.Y.Z |
ghcr.io/ifrcgo/go-api:vX.Y.Z.c<sha7> |
ifrcgo-helm:X.Y.Z-<sha7> |
yes (vX.Y.Z) |
The chart version comes from deploy/helm/Chart.yaml, which release.sh bumps.
The exact chart version to deploy is shown at the top of each GitHub Release.
Note
Branches containing a / (e.g. project/*) publish to a separate chart
(ifrcgo-dev-helm) and image (go-api-dev). Don't deploy these to staging or production.
The changelog is generated by git-cliff from commit messages, so they must follow
Conventional Commits (feat:, fix:, chore:, docs:, refactor:, ...).
Important
Commits without a Conventional Commit prefix are left out of the changelog.
Changes before the generated changelog (releases up to 1.1.509 and its "Unreleased" section) are kept in
CHANGELOG-legacy.md. START_COMMIT in release.sh is the last commit it covers.
typos,git-cliffsemveron yourPATH, sincerelease.shcalls it directly:# Install npm install -g semver # Check: prints 1.3.0 for a valid version npx semver v1.3.0
gh, logged in (gh auth login)- GPG-signed tags (
git config tag.gpgSign true), sincerelease.shverifies the tag - Run from a normal clone (not a git worktree) with the
fugitsubmodule checked out:git submodule update --init fugit
git checkout develop && git pull
./release.sh # enter the new version, e.g. v1.3.0
git push origin v1.3.0 # CI publishes image, chart and GitHub Release
git push origin develop # push the "chore(release): prepare for v1.3.0" commitThen deploy:
- Copy the chart version from the GitHub Release (e.g.
1.3.0-abc1234). - Staging: open a PR in go-deploy updating
targetRevisioninapplications/argocd/staging/applications/go-api.yaml. Merge after review. ArgoCD syncs staging. - Check the release on staging.
- Production: open a second go-deploy PR with the same chart version in
applications/argocd/production/applications/go-api.yaml. Merge after review. ArgoCD syncs production.
See go-deploy.md for ArgoCD access and sync details.
Use when production needs a fix but develop contains unreleased work.
git fetch --tags
git checkout -b hotfix/<short-name> v1.3.0 # the tag production is running
# fix, then commit: "fix: ..."
git push origin hotfix/<short-name>- Open a PR
hotfix/<short-name>→developand get it reviewed. The diff only contains the hotfix commits. - After approval, on the hotfix branch:
./release.sh # bump patch version, e.g. v1.3.1 (confirm the "not on develop" prompt) git push origin v1.3.1 hotfix/<short-name>
- Deploy the chart version from the
v1.3.1GitHub Release to staging, then production, via go-deploy PRs. - Merge the hotfix PR into
develop(resolveCHANGELOG.md/ version conflicts by keepingdevelop's version lines).
Use a -devN suffix (e.g. v1.3.1-dev0) to publish a pre-release that can be tried on staging first.
Revert the go-deploy commit for that environment to go back to the previous chart version.
Warning
Rollback does not reverse database migrations. Keep migrations backward compatible
(add first, remove in a later release). If a migration must be reversed, run
./manage.py migrate <app> <previous_migration> before rolling back the chart.