Migrate from docker/build-push-action@v1 to @v2
shrink opened this issue · comments
sam commented
Addition of buildx and caching will greatly speed up build time, down to under a minute.
Current flow: https://github.com/shrink/laravel-strict/blob/28bd1a0a3beb64ed2412209f6a193fc3e42cec39/.github/workflows/build.yml
- Login to GitHub Container Registry
- Repository --
ghcr.io/shrink/laravel-strict
add_git_labels
tag_with_ref
and push if tagged
sam commented
edit: nevermind, went in a different direction.
v2 accepts a tags
parameter which accepts zero or more tags as a string and will push them all: it would be neat to have an action that generated this list based on some configuration options, e.g: create a list with PR, branch and commit.
actions-docker-commit-tags
Inputs
- Image name: e.g:
ghcr.io/${{ github.repository }}
(default:ghcr.io/$GITHUB_REPOSITORY
) - Tag with... Pull Request
bool
true - Tag with... Branch
bool
true - Tag with... Tag
bool
true - Tag with... Short Commit Hash
bool
true - Tag with... Long Commit Hash
bool
false - Separator (default: comma?)
Outputs
- string list of tags separated by separator