Skip to content

Commit

Permalink
Use lowercase repo as the docker tag
Browse files Browse the repository at this point in the history
GitHub Packages (just like Docker Hub) doesn't allow repos containing uppercase chars.

There is also no need to use string concatenation.
  • Loading branch information
zzkW35 committed Aug 7, 2023
1 parent 1c1730a commit e54f8f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ fi
# Image Push location
REGISTRY=${REGISTRY:-"ghcr.io"}
IMAGE_REPOSITORY=${IMAGE_NAME:-$GITHUB_REPOSITORY}
IMAGE_LOCATION=$REGISTRY/$IMAGE_REPOSITORY
IMAGE_LOCATION=$(echo "$REGISTRY/$IMAGE_REPOSITORY" | tr '[:upper:]' '[:lower:]')

TAG="$IMAGE_LOCATION:py${PUBLISH_TARGET}-${PACKAGE_VERSION}"

TAGS=" -t $TAG"

# For the latest version we do extra stuff.
if [[ ! -z $PACKAGE_LATEST_VERSION ]] && [[ $PACKAGE_LATEST_VERSION = $PACKAGE_VERSION ]]; then
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST"
TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-LATEST"

VERSION_SHORTER=$(echo $PACKAGE_VERSION | cut -d"." -f1,2)
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}"
TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTER}"

VERSION_SHORTERER=$(echo $PACKAGE_VERSION | cut -d"." -f1)
if [[ $VERSION_SHORTERER != "0" ]]; then
TAGS+=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}"
TAGS=" -t $IMAGE_LOCATION:py${PUBLISH_TARGET}-${VERSION_SHORTERER}"
fi
fi

Expand Down

0 comments on commit e54f8f0

Please sign in to comment.