Skip to content

Build Images

Build Images #163

Workflow file for this run

name: Build Images
on:
push:
schedule:
- cron: '0 11 * * *'
env:
REGISTRY: ghcr.io
concurrency:
group: "${{ github.event_name}}-${{ github.ref }}"
cancel-in-progress: true
jobs:
build-images:
name: "Build Docker image"
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
environment: Release
strategy:
matrix:
image:
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=8
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=8-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=11
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=11-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=17
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=17-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=8
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=8
platform: linux/amd64,linux/arm64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=11
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=11
platform: linux/amd64,linux/arm64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=17
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=17
platform: linux/amd64,linux/arm64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=21
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=21
platform: linux/amd64,linux/arm64
- path: steamcmd
file: Dockerfile
image: pufferpanel/steamcmd
tags: |
type=raw,value=latest
platform: linux/amd64
- path: ubuntu
file: Dockerfile
image: pufferpanel/ubuntu
tags: |
type=raw,value=latest
platform: linux/amd64,linux/arm64
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: |
${{ matrix.image.image }}
tags: |
${{ matrix.image.tags }}
- name: Check out code
uses: actions/checkout@v4
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: ${{ matrix.image.path }}
file: ${{ matrix.image.path }}/${{ matrix.image.file }}
push: ${{ github.event_name != 'pull_request' && env.REGISTRY_USERNAME != '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
${{ matrix.image.arg }}
platforms: ${{ matrix.image.platform }}