From f25834b4ba22b5eb2894c2a005738d8ee8c69edc Mon Sep 17 00:00:00 2001 From: tigattack <10629864+tigattack@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:41:37 +0100 Subject: [PATCH] ci(build): simplify matrix --- .github/workflows/docker.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index efed5fe..9ae4925 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,13 +20,7 @@ jobs: packages: write strategy: matrix: - include: - - name: backend - dockerfile: docker/backend.Dockerfile - image: ${{ github.repository_owner }}/patchmon-backend - - name: frontend - dockerfile: docker/frontend.Dockerfile - image: ${{ github.repository_owner }}/patchmon-frontend + image: [backend, frontend] steps: - name: Checkout repository uses: actions/checkout@v5 @@ -45,7 +39,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ matrix.image }} + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/patchmon-${{ matrix.image }} tags: | type=ref,event=pr type=semver,pattern={{version}} @@ -53,14 +47,14 @@ jobs: type=semver,pattern={{major}} type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push ${{ matrix.name }} image + - name: Build and push ${{ matrix.image }} image uses: docker/build-push-action@v6 with: context: . - file: ${{ matrix.dockerfile }} + file: docker/${{ matrix.image }}.Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha,scope=${{ matrix.name }} - cache-to: type=gha,mode=max,scope=${{ matrix.name }} + cache-from: type=gha,scope=${{ matrix.image }} + cache-to: type=gha,mode=max,scope=${{ matrix.image }}