From 9a755944e7a91caff2598577e1df118db2b930ee Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 7 Nov 2024 19:54:05 -0500 Subject: [PATCH] ci: remove push redundant calls --- .forgejo/workflows/build-images.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/build-images.yml b/.forgejo/workflows/build-images.yml index 2498124..77686b6 100644 --- a/.forgejo/workflows/build-images.yml +++ b/.forgejo/workflows/build-images.yml @@ -33,12 +33,16 @@ jobs: - name: Push tagged images to registry if: ${{ github.event_name == 'push' }} run: | - podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:latest - podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:${{ steps.image-metadata.outputs.image-tag }} - podman push localhost/sesame/caddy:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/caddy:${{ github.ref_name }} - podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:latest - podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:${{ steps.image-metadata.outputs.image-tag }} - podman push localhost/sesame/promtail:latest ${{ vars.REGISTRY_ENDPOINT }}/sesame/promtail:${{ github.ref_name }} + for image in $(podman image ls --format {{.Repository}} | grep localhost/sesame) + do + for tag in latest ${{ steps.image-metadata.outputs.image-tag }} ${{ github.ref_name }} + do + SRC=$image:latest + DEST=${{ vars.REGISTRY_ENDPOINT }}/$image:$tag + echo "Pushing $SRC to $DEST" + podman push $SRC $DEST + done + done post-run: runs-on: imagefactory-latest needs: [build]