Merge pull request #631 from rare-magma/add-alpine-docker-image

Add alpine docker image version
This commit is contained in:
sstidl 2024-08-14 08:02:23 +02:00 committed by GitHub
commit 79436f0f0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 101 additions and 10 deletions

View file

@ -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 }}