From a54baf4b3dd740d9e5c862c7d2a884a734c11203 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 1 Jan 2024 20:42:26 +0000 Subject: [PATCH] Setup registry for buildx + Update CI to current defaults --- .forgejo/workflows/build+release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 6c1955b..44bb69d 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -5,7 +5,7 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' jobs: test: runs-on: docker @@ -51,6 +51,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."docker.io"] + mirrors = ["https://docker-cache.neshweb.net"] - name: Login to Docker Hub uses: docker/login-action@v3 @@ -58,12 +62,22 @@ jobs: registry: forgejo.neshweb.net username: ${{ secrets.FORGEJO_USERNAME }} password: ${{ secrets.FORGEJO_TOKEN }} + - + name: Determine Docker tags + id: tags + run: | + if echo ${{ github.ref_name }} | grep -qi '\-rc' ; then + echo latest=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:preview >> $GITHUB_OUTPUT; + else + echo latest=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:latest >> $GITHUB_OUTPUT; + fi + echo version=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:${{ github.ref_name }} >> $GITHUB_OUTPUT; - name: Push to Package Registry uses: docker/build-push-action@v5 with: push: true - tags: forgejo.neshweb.net/neshweb-sites/readyornot:${{ github.ref_name }}, forgejo.neshweb.net/neshweb-sites/readyornot:latest + tags: ${{ steps.tags.outputs.version }}, ${{ steps.tags.outputs.latest }} release: needs: build