From 10b662d1fd185d4612d8221f9a1535f90eb04786 Mon Sep 17 00:00:00 2001 From: Koopa Date: Wed, 10 Jan 2024 03:50:28 -0500 Subject: [PATCH] ci: add matrix + tags --- .github/workflows/build-deploy.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 7c65106..ba94678 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -6,8 +6,22 @@ on: jobs: build_deploy: runs-on: 'ubuntu-22.04' + strategy: + matrix: + image: + [ + { dockerfile: 'Dockerfile.pnpm', target: 'prep' }, + { dockerfile: 'Dockerfile.pnpm', target: 'home' }, + { dockerfile: 'Dockerfile.postgres', tag: 'postgres' } + ] # See: https://github.com/docker/build-push-action steps: + - name: Generate Docker tags + uses: docker/metadata-action@v5 + with: + images: 'hackbu/${{ matrix.image.target || matrix.image.tag }}' + tags: type=sha + flavor: latest=true # Docs: https://github.com/docker/setup-qemu-action - name: 'Setup QEMU to emulate other platforms' uses: 'docker/setup-qemu-action@v3' @@ -21,7 +35,10 @@ jobs: - name: 'Build and push' uses: 'docker/build-push-action@v5' with: - file: './docker/Dockerfile.pnpm' + file: './docker/${{ matrix.image.dockerfile }}' + target: '${{ matrix.image.target }}' platforms: 'linux/amd64,linux/arm64' # TODO - push: 'false' + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.tags }}