Skip to content

Build images

Build images #64

Workflow file for this run

name: Build images
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
schedule:
- cron: '20 2 * * SAT'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
multi:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
release:
- bullseye
- bookworm
context:
- debian-build
- debian-slim
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
-
name: Extract metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
tags: |
${{ matrix.release }}
type=schedule,prefix=${{ matrix.release }}-,pattern={{date 'YYYYMMDD'}}
type=sha,prefix=${{ matrix.release }}-,format=short
images: ghcr.io/pgils/${{ matrix.context }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Containerfile
build-args: "DEBIAN_VERSION=${{ matrix.release }}"
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}