From 2e027d015d04ae65bb7b1d009e4e11296181ad2f Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 8 Feb 2023 17:45:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20github:=20Use=20a=20matrix=20bui?= =?UTF-8?q?ld=20to=20DRY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72f26f3..2ef07fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,9 @@ on: jobs: docker: + strategy: + matrix: + subimage: ["core", "dinglehopper"] # core images need to come first! runs-on: ubuntu-latest steps: - @@ -23,7 +26,6 @@ jobs: uses: docker/setup-buildx-action@v2 # TODO data - # TODO matrix for all Dockerfiles - name: Login to Docker Hub uses: docker/login-action@v2 @@ -31,22 +33,12 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build core + name: Build ${{ matrix.subimage }} uses: docker/build-push-action@v4 with: context: . - file: Dockerfile-core + file: Dockerfile-${{ matrix.subimage }} build-args: DRONE_COMMIT=${{ github.sha }} push: true - tags: quratorspk/ocrd-galley-core:${{ github.sha }} - - - name: Build dinglehopper - uses: docker/build-push-action@v4 - with: - context: . - file: Dockerfile-dinglehopper - build-args: - DRONE_COMMIT=${{ github.sha }} - push: true - tags: quratorspk/ocrd-galley-dinglehopper:${{ github.sha }} + tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}