Go HTTP service with tests, a container image and versioned releases https://codebahn.net/docs/publish-container-images/
  • Go 86.5%
  • Dockerfile 13.5%
Find a file
Simon Nordberg fbc00a6bd2
All checks were successful
CI / test (push) Successful in 11s
CI / build (push) Successful in 16s
docs: describe the service, its releases and where to look (#11)
The README opened with `# Go` and never said what the service does. It now:

- names the service and documents its two routes and `PORT`
- links the places worth a look: #6, the CI runs, releases, the container image, #5, and the list of what Codebahn does not have
- describes CI as it runs after #9 (pull requests, pushes to `main`, and a weekly build)
- adds a Releases section for the workflow in #10
- links the current docs paths (`/docs/ci-runners/` instead of the old `/docs/features/ci-runners/` redirect)

Links use full `codebahn.net` URLs so the same README works on the GitHub copy. From there, a signed-out reader lands on the login page until signed-out deep links into the demo ship (codebahn-forgejo #312); after that they open the page itself.

Merge after #9 and #10, and after `v1.0.0` exists, so every link on the page lands on something.

Reviewed-on: #11
2026-10-27 12:00:07 +00:00
.github/workflows feat: publish a release and container image for each version tag (#10) 2026-10-27 11:48:29 +00:00
.gitignore chore: tidy CI triggers, module path and ignores (#9) 2026-10-27 11:47:12 +00:00
Dockerfile ci: run from .github/workflows on ubuntu-latest (#1) 2026-08-03 08:02:34 +00:00
go.mod chore: tidy CI triggers, module path and ignores (#9) 2026-10-27 11:47:12 +00:00
main.go feat: add go vet and go test to CI (#2) 2026-06-10 11:12:20 +00:00
main_test.go feat: add go vet and go test to CI (#2) 2026-06-10 11:12:20 +00:00
README.md docs: describe the service, its releases and where to look (#11) 2026-10-27 12:00:07 +00:00

Go HTTP service

A small Go web service with tests, a container image and versioned releases.

Route Response
GET /health ok
GET /hello?name=Ada Hello, Ada! (the name defaults to world)

It listens on PORT, or 8080 when that is unset.

This is one of Codebahn's example repositories. Its home is codebahn.net, where you can browse it read-only without an account.

Look around

  • Pull request #6: a smoke test that had never probed anything, the red runs that gave it away, and the fix.
  • CI runs: every pull request, every push to main and a weekly build, with full logs.
  • Releases: binaries built and attached for each version tag.
  • Container image: pushed to the built-in registry for each version tag.
  • Pull request #5: an open change with review comments and passing checks.
  • What Codebahn does not have: worth reading before you move.

CI

ci.yml is a GitHub Actions workflow, unchanged. On Codebahn:

  • .github/workflows/ is read directly. There is no .forgejo/ directory.
  • runs-on: ubuntu-latest routes to a Codebahn runner in Paris.
  • actions/checkout and actions/setup-go resolve from GitHub automatically.

On every pull request, every push to main, and every Monday morning it:

  1. Runs go vet and go test
  2. Builds the container image
  3. Starts the container and checks that /health answers

Need more than the 3 GB default? Set runs-on: codebahn-medium for 7 GB. See CI runners.

Releases

Push a version tag to publish one:

git tag v1.1.0
git push origin v1.1.0

release.yml pushes codebahn.net/demo-org/example-go:1.1.0 and :latest to the container registry, then publishes a release with static binaries for Linux, macOS and Windows plus SHA256SUMS. Both steps authenticate with the job's built-in token, so there are no secrets to configure. See Publish container images.

Run locally

go test ./...
go run .
# or
docker build -t example-go . && docker run -p 8080:8080 example-go