From 4ecd2ca60863472a9d35b15531a259237ca3836e Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Mon, 4 Mar 2024 13:42:30 -0600 Subject: [PATCH] ci(build): Add beta container image --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1a27cfb..bdceb996 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,6 +85,27 @@ jobs: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} FURY_TOKEN: ${{ secrets.FURY_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" + docker push "$DEST" + IMAGES+=("$DEST") + done \ + < <(docker image ls --format=json | \ + yq --input-format=json --output-format=tsv ' + select(.Repository == strenv(REPO)) | + [ + .Repository + ":" + .Tag, + .Repository + ":beta-" + (.Tag | sub(".*-", "")) + ] + ') + + docker manifest create "$REPO:beta" "${IMAGES[@]}" + docker manifest push "$REPO:beta" - uses: actions/upload-artifact@v4 with: name: dist