From dd145afa0487006b5f14147a35c60957473170ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20L=C3=B3pez-Doriga?= Date: Thu, 30 Nov 2023 10:42:24 +0100 Subject: [PATCH] adding latest tag for docker images --- .github/workflows/push_docker_image.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_docker_image.yml b/.github/workflows/push_docker_image.yml index 3ae9602..55f24bb 100644 --- a/.github/workflows/push_docker_image.yml +++ b/.github/workflows/push_docker_image.yml @@ -32,11 +32,17 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + # set latest tag for master branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'elixir-bsc') }} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Build and push Docker image uses: docker/build-push-action@v5 with: - # Indicates that the Docker build context is the current directory. - # Otherwise, it would be a Git URL (doing a separate clean checkout). context: ./frontend push: true tags: ${{ steps.meta.outputs.tags }}