From 16c893fa60f5e417e4b1f5cc7e938f2e2b7962d8 Mon Sep 17 00:00:00 2001 From: SorsOps <80043879+sorsOps@users.noreply.github.com> Date: Fri, 10 May 2024 14:01:08 +0200 Subject: [PATCH] Add matrix for docker build --- .github/workflows/publish.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7816b3607..f3ab8e918 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,11 +2,18 @@ name: Publish docker image on: push: - branches: [ token-studio-develop ] + branches: [ tokens-studio-develop ] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + include: + - dockerfile: Dockerfile.backend + type: backend + - dockerfile: Dockerfile.frontend + type: frontend permissions: contents: read packages: write @@ -24,20 +31,27 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GHCR_TOKEN }} - name: Docker meta id: meta uses: docker/metadata-action@v5 with: tags: | - type=sha,format=long + type=sha,format=long,prefix=${{matrix.type}}- images: | - ghcr.io/tokens-studio/token-flow + ghcr.io/tokens-studio/tokens-studio-for-penpot + - name: prebuild + run: | + echo "Building ${{ matrix.type }} image" + ./manage.sh build-${{matrix.type}}-bundle + mv ./bundles/${{matrix.type}} ./docker/images/bundle-${{matrix.type}}/ + - name: Publish Docker images uses: docker/build-push-action@v5 with: - context: . + context: ./docker/images + file: ./docker/images/${{ matrix.dockerfile }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}