latex/.github/workflows/main.yml
2020-03-29 19:12:39 +02:00

104 lines
3.4 KiB
YAML

name: Deploy
on:
push:
branches:
- master
- github-actions
schedule:
- cron: 0 18 * * *
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
- scheme: small
source: basic
- scheme: context
source: small
- scheme: gust
source: context
- scheme: medium
source: gust
- scheme: tetex
source: medium
- scheme: full
source: tetex
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