diff --git a/README.md b/README.md index 9c7df7e..3822024 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ or - **pull_image_and_stages**: Set to `false` to avoid pulling from the registry or to build from scratch (default: `true`). -- **stages_image_name**: Set custom name for stages. Useful if using a job matrix (default: `$image_name-stages)`. +- **stages_image_name**: Set custom name for stages/cache image (default: `${image_name}-stages`). Tags are ignored. - **push_image_and_stages**: Test a command before pushing. Use `false` to not push at all (default: `true`). diff --git a/docker-build.sh b/docker-build.sh index f3a3041..7764109 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -268,6 +268,8 @@ init_variables() { : "${INPUT_CONTEXT:=.}" : "${INPUT_DOCKERFILE:=Dockerfile}" : "${GITHUB_OUTPUT:=/dev/stdout}" + # ! ignore any tag in the custom cache image name + INPUT_STAGES_IMAGE_NAME=${INPUT_STAGES_IMAGE_NAME%:*} if _is_aws_ecr; then if [ -z "$INPUT_USERNAME" ]; then @@ -383,7 +385,7 @@ _build_image_buildkit() { echo -e "\n[Action Step] Building image with BuildKit..." local cache_image - cache_image="$(_get_full_stages_image_name)":latest + cache_image="$(_get_full_stages_image_name)":cache local cache_to if _must_push; then