latex/.github/workflows/main.yml

80 lines
2.6 KiB
YAML
Raw Normal View History

name: Deploy
2020-03-28 18:30:36 +01:00
on:
push:
branches:
- master
schedule:
- cron: 0 18 * * *
2020-03-28 18:30:36 +01:00
jobs:
2020-03-29 18:34:15 +02:00
build-scratch:
2020-03-28 18:30:36 +01:00
runs-on: ubuntu-latest
2020-03-29 18:34:15 +02:00
strategy:
matrix:
scheme: [infraonly, minimal, basic, small, context, gust, medium, tetex, full]
fail-fast: false
2020-03-28 18:30:36 +01:00
steps:
2020-03-29 18:34:15 +02:00
- uses: actions/checkout@v2
2020-03-29 18:34:15 +02:00
- name: Login to Dockerhub
run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
- name: Build ${{matrix.scheme}} from 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
2020-03-28 18:30:36 +01:00
2020-03-28 19:06:24 +01:00
build-incremental:
2020-03-28 18:30:36 +01:00
runs-on: ubuntu-latest
2020-03-29 18:34:15 +02:00
needs: [build-scratch]
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
- scheme: small
source: basic
- scheme: context
source: small
- scheme: gust
source: context
- scheme: medium
source: gust
- scheme: tetex
source: medium
- scheme: full
source: tetex
isLatest: true
2020-03-28 18:30:36 +01:00
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: ./incrental
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
2020-03-29 03:59:42 +02:00
- name: Upload ${{matrix.scheme}}
run: |
docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}
docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}
2020-03-28 19:06:24 +01:00
- name: Tag as latest
if: matrix.isLatest
2020-03-28 20:28:02 +01:00
run: |
docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental ${{secrets.DOCKERHUB_USER}}/latex:latest
2020-03-28 20:28:02 +01:00
docker push ${{secrets.DOCKERHUB_USER}}/latex:latest
2020-03-29 18:34:15 +02:00