From 8b4ef960d8cf1cd9c9b2f39eeefd02f0fa18f6b6 Mon Sep 17 00:00:00 2001 From: Nicolas Carlier Date: Sat, 20 Jan 2024 10:27:15 +0000 Subject: [PATCH] chore(ci): use matrix to separate slim and distrib build --- .github/workflows/build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f81ada..fcbdb20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,14 @@ jobs: publish: runs-on: ubuntu-latest needs: build + strategy: + fail-fast: false + matrix: + include: + - target: slim + suffix: '' + - target: distrib + suffix: -distrib steps: - uses: actions/checkout@v4 with: @@ -69,7 +77,8 @@ jobs: images: ncarlier/webhookd tags: | type=edge - type=semver,pattern={{version}} + type=semver,pattern={{major}},suffix=${{ matrix.suffix }} + type=semver,pattern={{version}},suffix=${{ matrix.suffix }} - uses: docker/setup-qemu-action@v1 with: image: tonistiigi/binfmt:latest @@ -80,21 +89,12 @@ jobs: with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Build and push Docker image (slim) + - name: Build and push Docker image (${{ matrix.target }}) uses: docker/build-push-action@v2 with: context: . - target: slim + target: ${{ matrix.target }} platforms: linux/amd64,linux/arm64,linux/arm/v7 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: Build and push Docker image (distrib) - uses: docker/build-push-action@v2 - with: - context: . - target: distrib - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }}-distrib - labels: ${{ steps.meta.outputs.labels }}