The default container pipeline
The standard 'build a Docker image and push it to a registry' shape uses three actions: docker/setup-buildx-action (multi-platform support), docker/login-action (auth to the registry), docker/build-push-action (build + push with cache).
Where to push
- ghcr.io (GitHub Container Registry) — best default. Auths via
GITHUB_TOKEN; same permissions model. - Docker Hub — historical default; image rate limits on free tier.
- ECR / Artifact Registry / ACR — when you're on AWS / GCP / Azure and want one bill.
Tag conventions worth using
:<sha-7>— every image traceable to a Git commit.:v1.4.2— release versions, on tag pushes only.:latest— moving pointer; do not use in production manifests.:edge— main branch tip; for staging.
Build cache
Use the GitHub Actions cache backend: cache-from: type=gha, cache-to: type=gha, mode=max. This gives layer caching across runs without configuring a separate registry cache.