Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ inputs:
build_extra_args:
description: "(Optional) Extra arguments to pass to docker build"
required: false
skip_create_repos:
description: "(Optional) Skip looking for & creating AWS ECR repos"
required: false
default: false

outputs:
FULL_IMAGE_NAME:
Expand Down
8 changes: 6 additions & 2 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ _aws_repo_exists() {
fi
}

_skip_create_repos() {
[ "$INPUT_SKIP_CREATE_REPOS" = true ]
}

_create_aws_ecr_repos() {
echo -e "\n[Action Step - AWS] Creating repositories (if needed)..."
local main_repo stages_repo
Expand Down Expand Up @@ -334,7 +338,7 @@ login_to_registry() {
}

create_repos() {
if ! _can_push; then
if ! _can_push || ! _skip_create_repos; then
Copy link
Owner

Choose a reason for hiding this comment

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

I think the condition should actually be:

  ! _can_push || _skip_create_repos

return
fi
if _is_aws_ecr; then
Expand Down Expand Up @@ -405,7 +409,7 @@ _build_image_buildkit() {

local cache_to
if _can_push; then
cache_to="--cache-to mode=max,image-manifest=true,type=registry,ref=$cache_image"
cache_to="--cache-to mode=max,image-manifest=true,type=registry,compression=zstd,ref=$cache_image"
Copy link
Owner

Choose a reason for hiding this comment

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

I prefer to leave the compression=zstd part for a separate (configurable) option as it can increase build time.

fi

_parse_extra_args
Expand Down