From 4eeb81fe174810c8d8726febcbf2e7f07ab39048 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 1 Jan 2024 19:44:39 +0100 Subject: [PATCH] Push Docker image to preview for -rc tags --- .forgejo/workflows/build+release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 30d52a5..156c4db 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -59,12 +59,21 @@ jobs: registry: forgejo.neshweb.net username: ${{ secrets.FORGEJO_USERNAME }} password: ${{ secrets.FORGEJO_TOKEN }} + - + name: Determine Docker tags + run: | + if github.ref_name | grep -qi '\-rc' ; then + LATEST=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:preview; + else + LATEST=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:latest; + fi + VERSION=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:${{ github.ref_name }} - name: Push to Package Registry uses: docker/build-push-action@v5 with: push: true - tags: forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:${{ github.ref_name }}, forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:latest + tags: $VERSION, $LATEST release: needs: build