From 0d8996a941d930f836f7350138785a838ab38405 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 2 Nov 2020 11:52:23 -0600 Subject: [PATCH] Update BuildImage.yml --- .github/workflows/BuildImage.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/BuildImage.yml b/.github/workflows/BuildImage.yml index 554544a..a157d09 100644 --- a/.github/workflows/BuildImage.yml +++ b/.github/workflows/BuildImage.yml @@ -19,6 +19,7 @@ jobs: if [ -z ${COMPOSE_TAG+x} ]; then COMPOSE_TAG=$(curl -sX GET "https://api.github.com/repos/linuxserver/docker-docker-compose/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); fi if [ -z ${COMPOSE_ALPINE_TAG+x} ]; then COMPOSE_ALPINE_TAG=$(curl -sX GET "https://api.github.com/repos/linuxserver/docker-docker-compose/releases" | jq -r 'first(.[] | select(.prerelease==true)) | .tag_name'); fi COMPOSE_VERSION=$(echo "$COMPOSE_TAG" | sed 's|-ls.*||g') + echo "COMPOSE_VERSION=${COMPOSE_VERSION}" >> $GITHUB_ENV COMPOSE_ALPINE_VERSION="$(echo ${COMPOSE_ALPINE_TAG} | sed 's|-ls.*||g' | sed 's|alpine-||g')" if [ "$COMPOSE_VERSION" != "$COMPOSE_ALPINE_VERSION" ]; then echo "ubuntu and alpine versions are different; exiting!" && exit 1; else echo "ubuntu and alpine versions are the same, continuing with build"; fi # Build image @@ -28,8 +29,10 @@ jobs: if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) }} run: | docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME} + docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.COMPOSE_VERSION }}-${{ github.sha }} docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME} + docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.COMPOSE_VERSION }}-${{ github.sha }} docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} - name: Credential check @@ -54,6 +57,7 @@ jobs: - name: Push tags to GitHub Container Registry if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.CR_USER && env.CR_PAT }} run: | + docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.COMPOSE_VERSION }}-${{ github.sha }} docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME} @@ -65,5 +69,6 @@ jobs: - name: Push tags to DockerHub if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.DOCKERUSER && env.DOCKERPASS }} run: | + docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.COMPOSE_VERSION }}-${{ github.sha }} docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }} docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}