ci: publish Docker images to GHCR on main and releases#83
Open
SirKitboard wants to merge 3 commits into
Open
Conversation
Add a docker-publish workflow that builds and pushes backend and frontend images to GitHub Container Registry on every push to main and on published releases. Images are tagged with `latest`, semver (on release), and a short SHA. Update docker-compose.yml and docker-compose.prod.yml to pull pre-built images from GHCR instead of building locally, so deployments (e.g. Unraid) only need docker compose pull + up. The dev compose is unchanged — frontend still builds from Dockerfile.dev and backend/worker mount local code for hot-reload. Scope the GHA layer cache in ci.yml so the CI docker-build job and the publish workflow share cache keys without colliding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When deploying wardrowbe on a NAS or home server (e.g. Unraid) using Docker Compose, the current setup requires a full Docker build on the deployment machine. This means the server needs build tooling, all source dependencies, and enough CPU/RAM to compile the images — not something you want on a NAS that's just meant to run containers.
Publishing pre-built images to GHCR means deployments become a simple
docker compose pull && docker compose up -d, with no build step needed on the host.Summary
.github/workflows/docker-publish.ymlthat builds and pusheswardrowbe-backendandwardrowbe-frontendimages to GitHub Container Registry on every push tomainand on published releasesservice-latestandservice-<sha>, with the registry path derived dynamically fromGITHUB_REPOSITORYlinux/amd64andlinux/arm64for Raspberry Pi compatibilitydocker-compose.ymlanddocker-compose.prod.ymlto pull pre-built images from GHCR instead of building locallyci.ymlso the existing docker-build job and the new publish workflow don't collideNotes
workerreuses the backend image with a different entrypoint command, consistent with the existing Dockerfile structuredocker-compose.dev.yml) is unchanged — frontend still builds fromDockerfile.devand backend/worker mount local code for hot-reloadGITHUB_TOKENwithpackages: writepermissionTest plan
mainand confirm both images appear under Packages on the repo pagedocker compose pull && docker compose up -dworks without a local build step