Skip to content

feat: add Docker build for sphinx-latex image #1

feat: add Docker build for sphinx-latex image

feat: add Docker build for sphinx-latex image #1

Workflow file for this run

name: Build and publish sphinx-latex Docker image
on:
push:
branches:
- master
paths:
- ".docker/sphinx-latex/**"
pull_request:
paths:
- ".docker/sphinx-latex/**"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push:
name: Build and push sphinx-latex image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5730e84e09ef46c65d80d5f65f899e59003028b # v3.10.0
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbea8a09e7f1f55b7a7b3b3ea4a8 # v5.7.0
with:
images: ghcr.io/${{ github.repository }}/sphinx-latex
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=sha-
- name: Build and push Docker image
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
with:
context: .docker/sphinx-latex
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/sphinx-latex:latest
cache-to: type=inline