From 975dd19ead6c6c3f4a8464a32e68d30bba03b6bf Mon Sep 17 00:00:00 2001 From: Valerian Saliou Date: Wed, 28 Aug 2024 18:57:22 +0200 Subject: [PATCH] chore: migrate to docker metadata --- .github/workflows/deploy.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bfe9f77..caf9495 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -75,6 +75,16 @@ jobs: env/nginx/ Dockerfile + - name: Acquire Docker image metadata + id: metadata + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=tag + type=raw,value=${{ needs.build.outputs.revision }} + type=raw,value=latest + - name: Log in to the container registry uses: docker/login-action@v3 with: @@ -94,10 +104,9 @@ jobs: uses: docker/build-push-action@v6 with: context: . + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} push: true - tags: - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build.outputs.revision }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest deploy: needs: build