Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ 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/cache image (default: `${image_name}-stages`). Tags are ignored.
- **stages_image_name**: Set custom name for stages/cache image (default: `${image_name}-stages`).

- **stages_image_tag**: Set custom tag for the stages/cache image. Only for buildkit. (deafult: latest)"
requires: false

- **push_image_and_stages**: Test a command before pushing. Use `false` to not push at all (default: `true`).

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ inputs:
stages_image_name:
description: "(Optional) Use a custom name for the stages. Useful if using a job matrix (default: ${image_name}-stages)"
required: false
stages_image_tag:
description: "(Optional) Use a custom tag for the stages image. Only for buildkit. (deafult: latest)"
requires: false
push_git_tag:
description: "(Optional) In addition to `image_tag` value, you can also push current git tag (default: false)"
required: false
Expand Down
8 changes: 6 additions & 2 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ _get_stages_image_name() {
echo "${INPUT_STAGES_IMAGE_NAME:-${INPUT_IMAGE_NAME}-stages}"
}

_get_stages_image_tag() {
echo "${INPUT_STAGES_IMAGE_TAG:-latest}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would make all stages to have tags like latest-1, latest-2, ... under legacy behavior (no buildkit) which I don't see it better than current behav.

}

_get_full_stages_image_name() {
echo "$(_get_image_namespace)$(_get_stages_image_name)"
}
}

_tag() {
local tag
Expand Down Expand Up @@ -396,7 +400,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)":"$(_get_stages_image_tag)"

local cache_from
if _can_pull; then
Expand Down