From 70d5f8466d21346106cc24defeec827a9ebf8ef6 Mon Sep 17 00:00:00 2001 From: Devis Lucato Date: Thu, 15 Feb 2024 13:53:31 -0800 Subject: [PATCH] Update docker-build-push.yml --- .github/workflows/docker-build-push.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 4699146d4..27b8041c1 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -1,4 +1,4 @@ -# Build image and push it to docker hub +# Build Docker image and push it to docker hub name: Docker Image Build and Push to DockerHub @@ -11,6 +11,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + ${{ vars.DOCKERHUB_USERNAME }}/service + # Docker tags to generate + tags: | + type=raw,value=latest + type=sha + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -28,6 +40,5 @@ jobs: with: push: true platforms: linux/amd64,linux/arm64 - tags: | - ${{ vars.DOCKERHUB_USERNAME }}/service:latest - ${{ vars.DOCKERHUB_USERNAME }}/service:${{ env.GITHUB_SHA }} + labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }}