|
@@ -26,6 +26,16 @@ env:
|
|
|
jobs:
|
|
|
build:
|
|
|
runs-on: ubuntu-latest
|
|
|
+ strategy:
|
|
|
+ fail-fast: false
|
|
|
+ matrix:
|
|
|
+ include:
|
|
|
+ - dockerfile: ./Dockerfile
|
|
|
+ image: ghcr.io/${{ github.repository }}
|
|
|
+ flavour: ""
|
|
|
+ - dockerfile: ./Dockerfile.alpine
|
|
|
+ image: ghcr.io/${{ github.repository }}
|
|
|
+ flavour: "-alpine"
|
|
|
permissions:
|
|
|
contents: read
|
|
|
packages: write
|
|
@@ -69,14 +79,16 @@ jobs:
|
|
|
id: meta
|
|
|
uses: docker/metadata-action@v5
|
|
|
with:
|
|
|
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
+ images: ${{ matrix.image }}
|
|
|
tags: |
|
|
|
- type=ref,event=branch
|
|
|
- type=ref,event=pr
|
|
|
+ type=ref,event=branch,suffix=${{ matrix.flavour }}
|
|
|
+ type=ref,event=pr,suffix=${{ matrix.flavour }}
|
|
|
# set latest tag for default branch
|
|
|
- type=raw,value=latest,enable={{is_default_branch}}
|
|
|
- type=semver,pattern={{version}}
|
|
|
- type=semver,pattern={{major}}.{{minor}}
|
|
|
+ type=raw,value=latest${{ matrix.flavour }},enable={{is_default_branch}}
|
|
|
+ type=semver,pattern={{version}}${{ matrix.flavour }}
|
|
|
+ type=semver,pattern={{major}}${{ matrix.flavour }}
|
|
|
+ type=semver,pattern={{major}}.{{minor}}${{ matrix.flavour }}
|
|
|
+ type=semver,pattern={{major}}.{{minor}}.{{patch}}${{ matrix.flavour }}
|
|
|
|
|
|
# Build and push Docker image with Buildx (don't push on PR)
|
|
|
# https://github.com/docker/build-push-action
|
|
@@ -85,6 +97,7 @@ jobs:
|
|
|
uses: docker/build-push-action@v5
|
|
|
with:
|
|
|
context: .
|
|
|
+ file: ${{ matrix.dockerfile }}
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|