diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 12d1605..3f44f1a 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -154,7 +154,6 @@ jobs: with: context: . build-args: | - VERSION=alt GROUP_ID=1000 USER_ID=1000 file: Dockerfile @@ -164,3 +163,20 @@ jobs: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest labels: version=${{ github.run_id }} + # For tagged releases, build and push the Docker image with the corresponding tag + - name: Build and Push Docker Image (Tagged) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v4 + with: + context: . + build-args: | + VERSION=alt + GROUP_ID=1000 + USER_ID=1000 + file: Dockerfile + push: true + tags: | + ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}-alt:${{ github.ref_name }} + ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}-alt:latest + labels: version=${{ github.run_id }} +