Fix Docker workflow issues (hopefully) (#143)

This hopefully fixes some of the issues of the docker workflow building
the book and website
This commit is contained in:
Hendrik Kleinwaechter
2023-07-09 15:05:30 +02:00
committed by GitHub
parent 58004497bd
commit 46ab05048e
6 changed files with 102 additions and 39 deletions

View File

@@ -9,11 +9,29 @@ jobs:
steps:
- name: Set up git repository
uses: actions/checkout@v3
- name: Bake the book
uses: docker://ghcr.io/hendricius/the-sourdough-framework:latest
- name: Print dependency versions
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd book
cd /app/book
make show_tools_version
- name: Print build variables
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make printvars
- name: Bake the book
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make bake
- name: Release baked book to S3
uses: shallwefootball/s3-upload-action@master

View File

@@ -9,11 +9,29 @@ jobs:
steps:
- name: Set up git repository
uses: actions/checkout@v3
- name: Bake the book
uses: docker://ghcr.io/hendricius/the-sourdough-framework:latest
- name: Print dependency versions
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd book
cd /app/book
make show_tools_version
- name: Print build variables
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make printvars
- name: Bake the book
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make website
- name: Release baked website to S3
uses: shallwefootball/s3-upload-action@master

View File

@@ -0,0 +1,32 @@
name: Validate LaTeX Document
on: [ push, pull_request ]
jobs:
test_building_book:
runs-on: ubuntu-latest
steps:
- name: Set up git repository
uses: actions/checkout@v3
- name: Print dependency versions
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make show_tools_version
- name: Print build variables
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make printvars
- name: Test baking the release versions
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hendricius/the-sourdough-framework:latest
options: -v ${{ github.workspace }}:/app
run: |
cd /app/book
make -j build_pdf build_serif_ebook

View File

@@ -1,14 +0,0 @@
name: Validate LaTeX Document
on: [ push, pull_request ]
jobs:
test_building_book:
runs-on: ubuntu-latest
steps:
- name: Set up git repository
uses: actions/checkout@v3
- name: Test baking the release versions
uses: docker://ghcr.io/hendricius/the-sourdough-framework:latest
with:
run: |
cd book
make -j build_pdf build_serif_ebook

View File

@@ -1,4 +1,4 @@
FROM ubuntu:latest
FROM ubuntu:rolling
LABEL "maintainer"="Hendrik Kleinwächter <hendrik.kleinwaechter@gmail.com>"
LABEL "repository"="https://github.com/hendricius/the-sourdough-framework"
@@ -15,10 +15,9 @@ RUN apt-get update && \
git \
wget
# Install LaTeX
# Install base LaTeX system
RUN apt-get install --yes -y --no-install-recommends \
texlive-full \
texlive-lang-all
texlive-full
# Install LaTeX extras
RUN apt-get install --yes -y --no-install-recommends \
@@ -28,19 +27,13 @@ RUN apt-get install --yes -y --no-install-recommends \
tex-gyre \
fonts-texgyre \
dvisvgm \
context
context \
python3-pygments \
python3-setuptools
RUN apt-get autoclean && apt-get --purge --yes autoremove
# Custom TeX packages on latest version
RUN git clone https://github.com/michal-h21/make4ht && \
cd make4ht && \
make justinstall SUDO=""
RUN git clone https://github.com/michal-h21/tex4ebook.git && \
cd tex4ebook && \
make && \
make install SUDO=""
WORKDIR /root
# Support to build amazon kindle books
RUN wget https://archive.org/download/kindlegen_linux_2_6_i386_v2_9/kindlegen_linux_2.6_i386_v2_9.tar.gz && \

View File

@@ -1,25 +1,41 @@
DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework
.PHONY: build_pdf
build_pdf: build_docker_image
build_pdf: mrproper
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make"
.PHONY: bake
bake: build_docker_image
bake: mrproper
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make bake"
.PHONY: build_docker_image
build_docker_image:
docker build -t $(DOCKER_IMAGE) -f Dockerfile --platform linux/amd64 .
docker build -t $(DOCKER_IMAGE) -f Dockerfile .
.PHONY: push_docker_image
push_docker_image:
docker push $(DOCKER_IMAGE):latest
.PHONY: website
website:
website: mrproper
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make website"
.PHONY: validate
validate:
validate: mrproper
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make -j build_pdf build_serif_ebook"
.PHONY: mrproper
mrproper:
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make mrproper"
.PHONY: show_tools_version
show_tools_version:
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make show_tools_version"
.PHONY: printvars
printvars:
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make printvars"
.PHONY: start_shell
start_shell:
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash