Skip to content

4.9.3: Docker fixes 2 #11

4.9.3: Docker fixes 2

4.9.3: Docker fixes 2 #11

# Runs on PR or Release and only if Dockerfile exists and not docs being updated
name: Docker matrix build & publish
on:
release:
types: [published]
branches:
- main
tags:
# paths-ignore:
# - 'docs/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
docker:
strategy:
matrix:
os: [buster, bullseye, bookworm]
java: [false, true]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: arm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
if: ${{ ! matrix.java }}
uses: docker/metadata-action@v5
with:
images: theyosh/terrariumpi
flavor: |
latest=false
suffix=-${{ matrix.os }},onlatest=false
- name: Docker meta - Java
id: metajava
if: ${{ matrix.java }}
uses: docker/metadata-action@v5
with:
images: theyosh/terrariumpi
flavor: |
latest=${{ matrix.os == 'buster' }}
suffix=-${{ matrix.os }}-java,onlatest=false
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
if: ${{ ! matrix.java }}
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.${{ matrix.os }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm/v7
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GITHUB_SHA=${{ github.sha }}
- name: Build and push - Java
if: ${{ matrix.java }}
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.${{ matrix.os }}
push: true
tags: ${{ steps.metajava.outputs.tags }}
labels: ${{ steps.metajava.outputs.labels }}
platforms: linux/arm/v7
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GITHUB_SHA=${{ github.sha }}
JAVA=default-jre-headless