Skip to content

Commit

Permalink
Merge pull request #145 from whoan/update-cache-image-usage
Browse files Browse the repository at this point in the history
Update cache image usage
  • Loading branch information
whoan authored Oct 28, 2023
2 parents c587982 + 85e9e2c commit 81b82cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`).

Expand Down
4 changes: 3 additions & 1 deletion docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 81b82cf

Please sign in to comment.