7f4feccf214f46bc60708813ddf2bf4599dbfb7d
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 3. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Docker Build and Push GitHub Actions Workflow
A Reusable Workflow of the Docker GitHub Actions steps. Enhanced with learnings from production use.
Reasons to use this workflow
- Easier to start with than hand-building all the Docker Actions into a single workflow.
- Provides inline docs based on real-world usage of this workflow.
- Gives you inputs so you can reuse this workflow across many repositories and only needing the full workflow stored in a central repository.
Steps to adopt this workflow
- Fork this repository and tweak the reusable workflow to your liking: .github/workflows/reusable-docker-build.yaml
- Copy my "calling" workflow
templates/call-docker-build.yamlto all the repos you want to build images in, and change it to point to the forked workflow above.
"But what does this workflow really do beyond just docker build?"
- Clone the repository
- Setup QEMU for multi-platform building (buildx) via docker/setup-qemu-action
- Setup buildx for awesome and fast building via docker/setup-buildx-action
- Log into Docker Hub and/or GHCR
- Add labels and tags via docker/metadata-action
- Build and push image via docker/build-push-action with layer caching
- Reports tags and labels in the PR comments
This repository is part of my example repos on GitHub Actions
- bretfisher/github-actions-templates - Main repository
- bretfisher/super-linter-workflow - Reusable linter workflow
- (you are here) bretfisher/docker-build-workflow- Reusable docker build workflow
- bretfisher/allhands22 - Step by step example of a Docker workflow
- My full list of container examples and tools
More reading
🎉🎉🎉 Join my container DevOps community 🎉🎉🎉
Languages
Dockerfile
100%