From f3e80a461a4bb27a4de8ce8c39f42648d270734d Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 23 Oct 2024 13:18:07 -0300 Subject: [PATCH] ci: add version to docker tags --- .github/workflows/docker.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index e61d953..7bf1947 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -14,8 +14,22 @@ jobs: runs-on: ${{ matrix.os }} + permissions: + contents: read + packages: write + steps: - uses: actions/checkout@v3 + - name: Docker Metadata action + uses: docker/metadata-action@v5.5.1 + id: meta + with: + images: | + ghcr.io/${{ github.repository }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + - uses: docker/setup-buildx-action@v2 - uses: docker/setup-qemu-action@v2 - uses: docker/login-action@v2 @@ -24,8 +38,10 @@ jobs: username: ${{ github.actor }} password: ${{ github.token }} - - uses: docker/build-push-action@v3 + - name: Build and push Docker images + uses: docker/build-push-action@v6.9.0 with: push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}