From 9ee829ded4f7c9d07fc3261217084ee180ad006a Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Wed, 15 May 2024 11:06:50 -0300 Subject: [PATCH] Build with labels and branches --- .github/workflows/build-docker.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 8b25b9e2..b7902e2d 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -4,6 +4,9 @@ on: push: branches: - 'main' + - 'fix/**' + - 'dev' + - 'dev/**' tags: - 'v*.*.*' env: @@ -39,10 +42,10 @@ jobs: id: metabackend uses: docker/metadata-action@v3 with: - # list of Docker images to use as base name for tags images: | ${{ env.REGISTRY }}/${{ env.IMAGE_BACKEND }} - # Docker tags based on the following events/attributes + labels: | + org.opencontainers.image.title=ticketz-backend tags: | type=ref,event=branch type=semver,pattern={{version}} @@ -54,10 +57,10 @@ jobs: id: metafrontend uses: docker/metadata-action@v3 with: - # list of Docker images to use as base name for tags images: | - ${{ env.REGISTRY }}/${{ env.IMAGE_BACKEND }} - # Docker tags based on the following events/attributes + ${{ env.REGISTRY }}/${{ env.IMAGE_FRONTEND }} + labels: | + org.opencontainers.image.title=ticketz-frontend tags: | type=ref,event=branch type=semver,pattern={{version}} @@ -73,6 +76,7 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.metabackend.outputs.tags }} + labels: ${{ steps.metabackend.outputs.labels }} - name: Build and push frontend Docker image id: frontend @@ -82,3 +86,4 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.metafrontend.outputs.tags }} + labels: ${{ steps.metafrontend.outputs.labels }}