Publishing a Docker image from CI should be repeatable and multi-architecture. This generator produces a GitHub Actions workflow that configures Docker Buildx, logs into Docker Hub or GHCR, builds with layer caching, and pushes tags derived automatically from your Git context.
How it works
The workflow chains the official Docker actions:
docker/setup-qemu-actionenables cross-architecture emulation for multi-platform builds.docker/setup-buildx-actionprovisions the Buildx builder.docker/login-actionauthenticates to the chosen registry.docker/metadata-actioncomputes tags and labels from the branch, semver tags, and commit SHA.docker/build-push-actionbuilds for your selected platforms, pushes the image, and reads/writes the GitHub Actions layer cache.
Tips and notes
- For GHCR, the workflow can use the built-in
GITHUB_TOKEN; for Docker Hub you must addDOCKERHUB_USERNAMEand aDOCKERHUB_TOKENaccess token. - Multi-platform builds are slower but produce a single tag that runs on both Intel and ARM hosts.
- Layer caching via
type=ghamakes incremental builds fast; cold builds still pay full cost. - The metadata action’s semver tags only appear when you push a Git tag like
v1.2.3.