From fcf6177bdc54feb9c7d79ba878d984cefd150bf1 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 18 Oct 2021 17:48:08 +0300 Subject: [PATCH] Fixed tag generation for releases --- .github/workflows/images_build.yml | 33 ++++++++++++++-------- .github/workflows/images_build_windows.yml | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/images_build.yml b/.github/workflows/images_build.yml index 01f465e0a..fed3d41d1 100644 --- a/.github/workflows/images_build.yml +++ b/.github/workflows/images_build.yml @@ -12,6 +12,7 @@ on: - 'trunk' paths: - 'Dockerfiles/**' + - '!**/README.md' - '!Dockerfiles/*/rhel/*' - '!Dockerfiles/*/windows/*' - '.github/workflows/images_build.yml' @@ -81,7 +82,7 @@ jobs: uses: tj-actions/branch-names@v5 build_base: - timeout-minutes: 90 + timeout-minutes: 70 name: Build base on ${{ matrix.os }} needs: init_build strategy: @@ -96,7 +97,8 @@ jobs: with: fetch-depth: 1 - - name: Set up QEMU + - + name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx @@ -121,10 +123,13 @@ jobs: with: images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ env.BASE_BUILD_NAME }} tags: | - type=ref,event=branch,prefix=${{ matrix.os }}- - type=ref,event=branch,suffix=-${{ matrix.os }} + type=semver,pattern={{version}},prefix=${{ matrix.os }}- + type=semver,pattern={{version}},suffix=-${{ matrix.os }} + type=ref,event=branch,prefix=${{ matrix.os }}-,suffix=-latest + type=ref,event=branch,suffix=-${{ matrix.os }}-latest + type=raw,enable=${{ needs.init_build.outputs.is_default_branch == 'true' }},value=${{matrix.os}}-latest flavor: | - latest=false + latest=${{ (matrix.os == 'alpine') && (needs.init_build.outputs.is_default_branch == 'true') }} - name: Build ${{ env.BASE_BUILD_NAME }}/${{ matrix.os }} and push id: docker_build @@ -191,10 +196,13 @@ jobs: with: images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }} tags: | - type=ref,event=branch,prefix=${{ matrix.os }}- - type=ref,event=branch,suffix=-${{ matrix.os }} + type=semver,pattern={{version}},prefix=${{ matrix.os }}- + type=semver,pattern={{version}},suffix=-${{ matrix.os }} + type=ref,event=branch,prefix=${{ matrix.os }}-,suffix=-latest + type=ref,event=branch,suffix=-${{ matrix.os }}-latest + type=raw,enable=${{ needs.init_build.outputs.is_default_branch == 'true' }},value=${{matrix.os}}-latest flavor: | - latest=false + latest=${{ (matrix.os == 'alpine') && (needs.init_build.outputs.is_default_branch == 'true') }} - name: Download SHA256 tag build-base:${{ matrix.os }} uses: actions/download-artifact@v2.0.10 @@ -287,10 +295,13 @@ jobs: with: images: ${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }} tags: | - type=ref,event=branch,prefix=${{ matrix.os }}- - type=ref,event=branch,suffix=-${{ matrix.os }} + type=semver,pattern={{version}},prefix=${{ matrix.os }}- + type=semver,pattern={{version}},suffix=-${{ matrix.os }} + type=ref,event=branch,prefix=${{ matrix.os }}-,suffix=-latest + type=ref,event=branch,suffix=-${{ matrix.os }}-latest + type=raw,enable=${{ needs.init_build.outputs.is_default_branch == 'true' }},value=${{matrix.os}}-latest flavor: | - latest=false + latest=${{ (matrix.os == 'alpine') && (needs.init_build.outputs.is_default_branch == 'true') }} - name: Download SHA256 tag for ${{ steps.build_base_image.outputs.build_base }}:${{ matrix.os }} uses: actions/download-artifact@v2.0.10 diff --git a/.github/workflows/images_build_windows.yml b/.github/workflows/images_build_windows.yml index 86c69d131..8c2e37e81 100644 --- a/.github/workflows/images_build_windows.yml +++ b/.github/workflows/images_build_windows.yml @@ -12,6 +12,7 @@ on: - 'trunk' paths: - 'Dockerfiles/*/windows/*' + - '!**/README.md' - '.github/workflows/images_build_windows.yml' defaults: