Files
latex-container/.gitea/workflows/build.yml
Julian Pollinger 702cafd0ef
Some checks failed
Build Docker Image / build (default) (push) Failing after 5m34s
Build Docker Image / build (python) (push) Failing after 7m56s
Add build matrix strategy for Docker flavors and update caching configuration
2025-02-16 19:37:08 +01:00

56 lines
1.6 KiB
YAML

name: Build Docker Image
on:
push:
branches:
- main
schedule:
- cron: '0 0 1,7,14,21,28 * *'
workflow_dispatch: # Allows manual triggering
jobs:
build:
strategy:
matrix:
flavor: [default, python]
runs-on: docker-builder
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: true
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
git.pollinger.dev/public/texlive
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.flavor == 'default' }}
type=raw,value=${{ matrix.flavor }},enable=${{ github.ref == 'refs/heads/main' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.pollinger.dev
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
target: ${{ matrix.flavor }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=git.pollinger.dev/public/texlive:build-cache-${{ matrix.flavor }}
cache-to: mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=git.pollinger.dev/public/texlive:build-cache-${{ matrix.flavor }}