mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-11-09 12:41:12 -06:00
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:
committed by
GitHub
parent
58004497bd
commit
46ab05048e
24
.github/workflows/release-book.yml
vendored
24
.github/workflows/release-book.yml
vendored
@@ -9,11 +9,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Set up git repository
|
- name: Set up git repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Bake the book
|
- name: Print dependency versions
|
||||||
uses: docker://ghcr.io/hendricius/the-sourdough-framework:latest
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
|
image: ghcr.io/hendricius/the-sourdough-framework:latest
|
||||||
|
options: -v ${{ github.workspace }}:/app
|
||||||
run: |
|
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
|
make bake
|
||||||
- name: Release baked book to S3
|
- name: Release baked book to S3
|
||||||
uses: shallwefootball/s3-upload-action@master
|
uses: shallwefootball/s3-upload-action@master
|
||||||
|
|||||||
24
.github/workflows/release-website.yml
vendored
24
.github/workflows/release-website.yml
vendored
@@ -9,11 +9,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Set up git repository
|
- name: Set up git repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Bake the book
|
- name: Print dependency versions
|
||||||
uses: docker://ghcr.io/hendricius/the-sourdough-framework:latest
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
|
image: ghcr.io/hendricius/the-sourdough-framework:latest
|
||||||
|
options: -v ${{ github.workspace }}:/app
|
||||||
run: |
|
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
|
make website
|
||||||
- name: Release baked website to S3
|
- name: Release baked website to S3
|
||||||
uses: shallwefootball/s3-upload-action@master
|
uses: shallwefootball/s3-upload-action@master
|
||||||
|
|||||||
32
.github/workflows/validate-book-build.yml
vendored
Normal file
32
.github/workflows/validate-book-build.yml
vendored
Normal 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
|
||||||
14
.github/workflows/validate.yml
vendored
14
.github/workflows/validate.yml
vendored
@@ -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
|
|
||||||
21
Dockerfile
21
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM ubuntu:latest
|
FROM ubuntu:rolling
|
||||||
|
|
||||||
LABEL "maintainer"="Hendrik Kleinwächter <hendrik.kleinwaechter@gmail.com>"
|
LABEL "maintainer"="Hendrik Kleinwächter <hendrik.kleinwaechter@gmail.com>"
|
||||||
LABEL "repository"="https://github.com/hendricius/the-sourdough-framework"
|
LABEL "repository"="https://github.com/hendricius/the-sourdough-framework"
|
||||||
@@ -15,10 +15,9 @@ RUN apt-get update && \
|
|||||||
git \
|
git \
|
||||||
wget
|
wget
|
||||||
|
|
||||||
# Install LaTeX
|
# Install base LaTeX system
|
||||||
RUN apt-get install --yes -y --no-install-recommends \
|
RUN apt-get install --yes -y --no-install-recommends \
|
||||||
texlive-full \
|
texlive-full
|
||||||
texlive-lang-all
|
|
||||||
|
|
||||||
# Install LaTeX extras
|
# Install LaTeX extras
|
||||||
RUN apt-get install --yes -y --no-install-recommends \
|
RUN apt-get install --yes -y --no-install-recommends \
|
||||||
@@ -28,19 +27,13 @@ RUN apt-get install --yes -y --no-install-recommends \
|
|||||||
tex-gyre \
|
tex-gyre \
|
||||||
fonts-texgyre \
|
fonts-texgyre \
|
||||||
dvisvgm \
|
dvisvgm \
|
||||||
context
|
context \
|
||||||
|
python3-pygments \
|
||||||
|
python3-setuptools
|
||||||
|
|
||||||
RUN apt-get autoclean && apt-get --purge --yes autoremove
|
RUN apt-get autoclean && apt-get --purge --yes autoremove
|
||||||
|
|
||||||
# Custom TeX packages on latest version
|
WORKDIR /root
|
||||||
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=""
|
|
||||||
|
|
||||||
# Support to build amazon kindle books
|
# 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 && \
|
RUN wget https://archive.org/download/kindlegen_linux_2_6_i386_v2_9/kindlegen_linux_2.6_i386_v2_9.tar.gz && \
|
||||||
|
|||||||
26
makefile
26
makefile
@@ -1,25 +1,41 @@
|
|||||||
DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework
|
DOCKER_IMAGE := ghcr.io/hendricius/the-sourdough-framework
|
||||||
|
|
||||||
.PHONY: build_pdf
|
.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"
|
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make"
|
||||||
|
|
||||||
.PHONY: bake
|
.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"
|
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make bake"
|
||||||
|
|
||||||
.PHONY: build_docker_image
|
.PHONY: build_docker_image
|
||||||
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
|
.PHONY: push_docker_image
|
||||||
push_docker_image:
|
push_docker_image:
|
||||||
docker push $(DOCKER_IMAGE):latest
|
docker push $(DOCKER_IMAGE):latest
|
||||||
|
|
||||||
.PHONY: website
|
.PHONY: website
|
||||||
website:
|
website: mrproper
|
||||||
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make website"
|
docker run -it -v $(PWD):/opt/repo $(DOCKER_IMAGE) /bin/bash -c "cd /opt/repo/book && make website"
|
||||||
|
|
||||||
.PHONY: validate
|
.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"
|
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
|
||||||
Reference in New Issue
Block a user