From df8bce69a7e9320480d9e8882f7db600334d1098 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 16 Aug 2023 03:51:45 -0500 Subject: [PATCH] ci: Push beta Docker image --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccd397f..798cee4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,6 +77,27 @@ jobs: FURY_TOKEN: ${{ secrets.FURY_TOKEN }} HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN }} AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} + - name: Push beta image + if: github.ref_name == 'main' + run: | + export REPO="$(tr '[[:upper:]]' '[[:lower:]]' <<< "ghcr.io/$GITHUB_REPOSITORY")" + IMAGES=() + while read -r SOURCE DEST; do + docker tag "$SOURCE" "$DEST" + IMAGES+=("$DEST") + done \ + < <(docker image ls --format=json | \ + yq --input-format=json --no-doc '[.]' | \ + yq --output-format=tsv '.[] | + select(.Repository == strenv(REPO)) | + [ + .Repository + ":" + .Tag, + .Repository + ":debug-" + (.Tag | sub(".*-", "")) + ] + ') + + docker manifest create "$REPO:debug" "${IMAGES[@]}" + docker manifest push "$REPO:debug" - uses: actions/upload-artifact@v3 with: name: dist