Skip to content

Build and publish docker base images #59

Build and publish docker base images

Build and publish docker base images #59

Workflow file for this run

name: Build and publish docker base images
on:
schedule:
- cron: "0 0 * * MON"
workflow_dispatch:
inputs:
publish:
description: "Publish image on GitHub Container Registry"
required: true
default: "true"
jobs:
build:
strategy:
matrix:
include:
- base-image: ubuntu:24.04
tag-name: ubuntu-24.04
expected-texlive-version: "2023.20240207-1"
- base-image: ubuntu:24.10
tag-name: ubuntu-24.10
expected-texlive-version: "2024.20240706-1"
- base-image: ubuntu:25.04
tag-name: ubuntu-25.04
expected-texlive-version: "2024.20250309-1"
- base-image: debian:13
tag-name: debian-13
expected-texlive-version: "2024.20250309-1"
- base-image: ubuntu:25.10
tag-name: ubuntu-25.10
expected-texlive-version: "2024.20250309-1"
- base-image: debian:testing
tag-name: debian-testing
expected-texlive-version: "2025.20251127-1"
- base-image: debian:unstable
tag-name: debian-unstable
expected-texlive-version: "2025.20251127-1"
fail-fast: false
runs-on: ubuntu-latest
defaults:
run:
working-directory: docker
steps:
- uses: actions/checkout@v4
- name: Create image
run: |
BASE_IMAGE="${{ matrix.base-image }}"
TAG_NAME="${{ matrix.tag-name }}"
docker build --build-arg BASE_IMAGE=${BASE_IMAGE} -t ghcr.io/dmf-unicatt/latex-packages:latest-${TAG_NAME} .
- name: Check texlive-base version
run: |
TAG_NAME="${{ matrix.tag-name }}"
EXPECTED_VERSION="${{ matrix.expected-texlive-version }}"
ACTUAL_VERSION=$(docker run --rm ghcr.io/dmf-unicatt/latex-packages:latest-${TAG_NAME} \
bash -c "dpkg -s texlive-base | grep '^Version:' | awk '{print \$2}'")
echo "Detected texlive-base version: $ACTUAL_VERSION"
if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then
echo "Version mismatch! Expected version was $EXPECTED_VERSION, but got $ACTUAL_VERSION"
exit 1
fi
- name: Login to GitHub Container Registry
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.publish == 'true')
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Publish image to GitHub packages
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.publish == 'true')
run: |
TAG_NAME="${{ matrix.tag-name }}"
docker push ghcr.io/dmf-unicatt/latex-packages:latest-${TAG_NAME}
warn:
runs-on: ubuntu-latest
if: github.repository == 'dmf-unicatt/latex-packages' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
steps:
- name: Warn if scheduled workflow is about to be disabled
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
with:
workflow-filename: docker.yml
days-elapsed: 50