ci: build & publish app + bot images to Gitea registry on merge #53
Reference in New Issue
Block a user
No description provided.
Delete Branch "ci/gitea-actions-image-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a Gitea Actions workflow (
.gitea/workflows/build-images.yml) that builds and pushes the Docker images to Gitea's built-in container registry on every merge tomain, so production pulls prebuilt images instead of building on the host.On the always-on
ubuntu-latestrunner it:gitea.whitlocktech.comwith a PAT.:latestand:sha-<7char>:gitea.whitlocktech.com/<owner>/website-app—./Dockerfile(server + client; the client is built inside the image)gitea.whitlocktech.com/<owner>/website-bot—./bot/DockerfileDesign choices: raw
dockerCLI (no marketplace actions → portable on self-hosted Gitea); the shared host Docker socket gives free layer caching between runs; registry owner is lowercased for Docker refs;concurrencycancels superseded builds.Required setup before this runs green
Two repo secrets (Settings → Actions → Secrets):
REGISTRY_USERREGISTRY_TOKENwrite:packagescopeCreate the token under avatar → Settings → Applications → Manage Access Tokens (scope:
package→write). Also ensure Actions is enabled for the repo, and the runner mounts/var/run/docker.sockinto its job containers (act_runnercontainer.docker_host: "-").Testing
Merge this PR (or use Actions → Build container images → Run workflow) to trigger it, then
docker pull gitea.whitlocktech.com/<owner>/website-app:lateston the host to confirm.Follow-up (separate PR, once this is verified)
Wire
docker-compose.yml(or adocker-compose.prod.ymloverride) to useimage:from this registry instead ofbuild:, so the host pulls the published images. Optional after that: an auto-deploy job and av*semver-tag trigger.🤖 Generated with Claude Code
https://claude.ai/code/session_0114TpmrNW4wNXsHq5CR72jQ
Add a Gitea Actions workflow (.gitea/workflows/build-images.yml) that fires on push to main (and workflow_dispatch). On the always-on ubuntu-latest runner it: - verifies the host Docker daemon is reachable (socket must be mounted) - logs into gitea.whitlocktech.com with a PAT (REGISTRY_USER / REGISTRY_TOKEN) - builds & pushes both images from the existing Dockerfiles, each tagged :latest and :sha-<7>: gitea.whitlocktech.com/<owner>/website-app (./Dockerfile — server+client) gitea.whitlocktech.com/<owner>/website-bot (./bot/Dockerfile) Raw docker CLI (no marketplace actions) for portability on self-hosted Gitea; the shared host daemon gives free layer caching between runs. Registry owner is lowercased for Docker refs. Deploy (compose image: + pull) is a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0114TpmrNW4wNXsHq5CR72jQ