Merge branch 'github-actions'

This commit is contained in:
Marcel Schwarz 2020-03-29 19:57:44 +02:00
commit 26927c8bef
14 changed files with 130 additions and 58 deletions

102
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,102 @@
name: Deploy
on:
push:
branches:
- master
schedule:
- cron: 0 18 * * 0
jobs:
build-infraonly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Dockerhub
run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
- name: Build infraonly-scratch
working-directory: ./scratch
run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch --build-arg SCHEME=infraonly .
- name: Upload infraonly-scratch image
run: docker push ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch
- name: Upload infraonly
run: |
docker tag ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch ${{secrets.DOCKERHUB_USER}}/latex:infraonly
docker push ${{secrets.DOCKERHUB_USER}}/latex:infraonly
build-scratch:
runs-on: ubuntu-latest
strategy:
matrix:
scheme: [minimal, basic, small, context, gust, medium, tetex, full]
include:
- scheme: full
isLatest: true
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Login to Dockerhub
run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
- name: Build ${{matrix.scheme}}-scratch
working-directory: ./scratch
run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch --build-arg SCHEME=${{matrix.scheme}} .
- name: Upload ${{matrix.scheme}}-scratch image
run: docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch
- name: Upload ${{matrix.scheme}}
run: |
docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}
docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}
- name: Tag as latest
if: matrix.isLatest
run: |
docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch ${{secrets.DOCKERHUB_USER}}/latex:latest
docker push ${{secrets.DOCKERHUB_USER}}/latex:latest
build-incremental:
runs-on: ubuntu-latest
needs: [build-infraonly]
strategy:
max-parallel: 1
fail-fast: true
matrix:
scheme : [minimal, basic, small, context, gust, medium, tetex, full]
include:
- scheme: minimal
source: infraonly
- scheme: basic
source: minimal-incremental
- scheme: small
source: basic-incremental
- scheme: context
source: small-incremental
- scheme: gust
source: context-incremental
- scheme: medium
source: gust-incremental
- scheme: tetex
source: medium-incremental
- scheme: full
source: tetex-incremental
steps:
- uses: actions/checkout@v2
- name: Login to Dockerhub
run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
- name: Build ${{matrix.scheme}}
working-directory: ./incremental
run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental --build-arg SOURCE=${{matrix.source}} --build-arg SCHEME=${{matrix.scheme}} .
- name: Upload ${{matrix.scheme}}-incremental
run: docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental

View File

@ -1,18 +1,21 @@
![Deploy](https://github.com/icaotix-docker/latex/workflows/Deploy/badge.svg)
# Schemes/Tags # Schemes/Tags
## Sizes ## Sizes
* `infraonly` - infrastructure-only scheme (no TeX at all) * `infraonly`, `infraonly-scratch` - infrastructure-only scheme (no TeX at all)
* `minimal` - minimal scheme (plain only) * `minimal`, `minimal-scratch`, `minimal-incremental` - minimal scheme (plain only)
* `basic` - basic scheme (plain and latex) * `basic`, `basic-scratch`, `basic-incremental` - basic scheme (plain and latex)
* `small` - small scheme (basic + xetex, metapost, a few languages) * `small`, `small-scratch`, `small-incremental` - small scheme (basic + xetex, metapost, a few languages)
* `medium` - medium scheme (small + more packages and languages) * `medium`, `medium-scratch`, `medium-incremental` - medium scheme (small + more packages and languages)
* `full`, `latest` - full scheme (everything) * `full`, `full-scratch`, `full-incremental`, `latest` - full scheme (everything)
## Extra Schemes ## Extra Schemes
* `gust` - GUST TeX Live scheme * `gust`, `gust-scratch`, `gust-incremental` - GUST TeX Live scheme
* `context` - ConTeXt scheme * `context`, `context-scratch`, `context-incremental` - ConTeXt scheme
* `tetex` - teTeX scheme (more than medium, but nowhere near full) * `tetex`, `tetex-scratch`, `tetex-incremental` - teTeX scheme (more than medium, but nowhere near full)
## Build Info (Image tree) ## Build Info `<tag>-incremental` (Image tree)
Images with this tag have all previous layers built in, use them for better caching.
``` ```
infraonly (base image with ubuntu:18.04) infraonly (base image with ubuntu:18.04)
+---> minimal +---> minimal
@ -24,8 +27,12 @@ infraonly (base image with ubuntu:18.04)
+---> tetex +---> tetex
+---> full +---> full
``` ```
NOTE: infraonly has no `incremental` tag.
# How to use ## Build Info `<tag>-scratch`
These images are built from the base ubuntu:18.04 image. They only have one latex layer. They are usually a little bit smaller than their `incremental` counterparts. The `scratch` image is default when used with no tag extension. Also `latest` is built from scratch and is the same as `full` and `full-scratch`.
# How to use the image
Mount your source code at `/data` and run whatever you want with LaTeX. Mount your source code at `/data` and run whatever you want with LaTeX.
# How to extend an Image # How to extend an Image
@ -34,7 +41,7 @@ To extend the one of the docker-images with your packages.
`FROM icaotix/latex:<tag>` `FROM icaotix/latex:<tag>`
#### Install latex packages #### Install latex packages
` RUN tlmgr install latexmk ` ` RUN tlmgr install latexmk `
` RUN tlmgr install biber ` ` RUN tlmgr install biber `
#### Minted + Pygments #### Minted + Pygments

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:minimal
RUN tlmgr install scheme-basic

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:small
RUN tlmgr install scheme-context

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:tetex
RUN tlmgr install scheme-full

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:context
RUN tlmgr install scheme-gust

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:gust
RUN tlmgr install scheme-medium

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:infraonly
RUN tlmgr install scheme-minimal

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:basic
RUN tlmgr install scheme-small

View File

@ -1,3 +0,0 @@
FROM icaotix/latex:medium
RUN tlmgr install scheme-tetex

6
incremental/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
ARG SOURCE
FROM icaotix/latex:$SOURCE
ARG SCHEME
RUN tlmgr install scheme-${SCHEME}

View File

@ -8,11 +8,12 @@ RUN apt-get update -q \
&& apt-get install -qy build-essential wget libfontconfig1 \ && apt-get install -qy build-essential wget libfontconfig1 \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install TexLive with scheme-infraonly ARG SCHEME
RUN wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz \ RUN wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz \
&& mkdir /install-tl-unx \ && mkdir /install-tl-unx \
&& tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1 \ && tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1 \
&& echo "selected_scheme scheme-infraonly" >> /install-tl-unx/texlive.profile \ && echo "selected_scheme scheme-${SCHEME}" >> /install-tl-unx/texlive.profile \
&& /install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile \ && /install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile \
&& rm -r /install-tl-unx \ && rm -r /install-tl-unx \
&& rm install-tl-unx.tar.gz && rm install-tl-unx.tar.gz

View File

@ -1,10 +0,0 @@
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /data
RUN apt-get update -q && apt-get install -qy \
texlive-base biber\
python-pygments gnuplot \
make git \
&& rm -rf /var/lib/apt/lists/*

View File

@ -1,10 +0,0 @@
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /data
RUN apt-get update -q && apt-get install -qy \
texlive-base biber\
python-pygments gnuplot \
make git \
&& rm -rf /var/lib/apt/lists/*