From fc668e84f134e351682ba461c2e12376815cbdbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Ramiro=20D=C3=ADaz?= Date: Sun, 18 Feb 2024 17:48:27 -0300 Subject: [PATCH] improvement: build better tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Agustín Ramiro Díaz --- .../workflows/push-matchbox_server-dockerhub.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-matchbox_server-dockerhub.yml b/.github/workflows/push-matchbox_server-dockerhub.yml index 0f754847..8aa24325 100644 --- a/.github/workflows/push-matchbox_server-dockerhub.yml +++ b/.github/workflows/push-matchbox_server-dockerhub.yml @@ -15,6 +15,15 @@ jobs: with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ vars.DOCKERHUB_USERNAME }}/matchbox_server + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push @@ -22,4 +31,6 @@ jobs: with: push: true file: matchbox_server/Dockerfile - tags: ${{ vars.DOCKERHUB_USERNAME }}/matchbox_server:${{github.ref_name}} + # Remove the 'v' from the tag + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}