What does `docker/metadata-action` do in GitHub Actions?
IntermediateProductionBuild Performance & CI
Answer
It generates tags and labels from the git context (branch, PR, semver tag, SHA) for docker/build-push-action.
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/org/app
tags: |
type=sha
type=semver,pattern={{version}}
- uses: docker/build-push-action@v6
with: { push: true, tags: "${{ steps.meta.outputs.tags }}", labels: "${{ steps.meta.outputs.labels }}" }
More on Build Performance & CI
How do you make Docker builds fast in CI where runners are ephemeral?BeginnerWhat are the cache backends in buildx?BeginnerWhy does `inline` cache often disappoint?AdvancedHow do you structure a Python Dockerfile for the best caching and size?IntermediateHow do you structure a Node.js production image?IntermediateHow do you build a small Java image?Beginner