Skip to content

Commit

Permalink
Simplify tags
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmhewitt authored Mar 16, 2023
1 parent a316cdb commit 069678a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ jobs:
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
IMAGE="${{ matrix.image }}"
IMAGE_NAME="$(echo "$IMAGE" | awk -F'-' '{print $1}')"
# cut the first hyphenated section from tag name, since it will be the image name instead
TAG=${IMAGE#*-}
cd "$IMAGE" || exit 1
# don't build default tags.
declare -a arr=("stable" "stable-installer" "unstable" "unstable-installer" "latest")
if [[ ! "${arr[@]}" =~ "$IMAGE" ]]; then
# rename unstable tags to latest
if [ "$TAG" == "unstable" ]; then TAG="latest"; fi
if [ "$TAG" == "unstable-installer" ]; then TAG="installer"; fi
docker build -t "$IMAGE_NAME":"$TAG" .
docker tag "$IMAGE_NAME":"$TAG" ghcr.io/${{ github.repository_owner }}/"$IMAGE_NAME":"$TAG"
docker push ghcr.io/${{ github.repository_owner }}/"$IMAGE_NAME":"$TAG"
fi
docker build -t ghcr.io/${{ github.repository_owner }}/docker:"$IMAGE" .
docker push ghcr.io/${{ github.repository_owner }}/docker:"$IMAGE"

0 comments on commit 069678a

Please sign in to comment.