Update ci.yml to perform a multi-variant build

This commit is contained in:
Roberto Banić
2023-04-13 01:22:57 +02:00
parent f7e3f8ae2a
commit 99d217e8f1
2 changed files with 15 additions and 8 deletions

View File

@@ -24,6 +24,13 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: pytest needs: pytest
strategy:
matrix:
include:
- dockerfile: Dockerfile
variant: alpine
- dockerfile: Dockerfile.slim
variant: slim
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -37,12 +44,12 @@ jobs:
with: with:
images: ${{ secrets.DOCKER_USERNAME }}/jellyplex-watched # list of Docker images to use as base name for tags images: ${{ secrets.DOCKER_USERNAME }}/jellyplex-watched # list of Docker images to use as base name for tags
tags: | tags: |
type=raw,value=latest,enable={{is_default_branch}} type=raw,value=${{ matrix.variant }},enable={{is_default_branch}}
type=ref,event=branch type=ref,event=branch,suffix=${{ matrix.variant }}
type=ref,event=pr type=ref,event=pr,suffix=${{ matrix.variant }}
type=semver,pattern={{version}} type=semver,pattern={{version}},suffix=${{ matrix.variant }}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}},suffix=${{ matrix.variant }}
type=sha type=sha,suffix=${{ matrix.variant }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
@@ -63,7 +70,7 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: . context: .
file: ./Dockerfile file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: false push: false
tags: jellyplex-watched:action tags: jellyplex-watched:action
@@ -74,7 +81,7 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: . context: .
file: ./Dockerfile file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true
tags: ${{ steps.docker_meta.outputs.tags }} tags: ${{ steps.docker_meta.outputs.tags }}