-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e94e9f1
Showing
39 changed files
with
2,490 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Release the book | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
LATEST_IMAGE: ghcr.io/${{ github.repository }}:latest | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# Buildx for caching | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
release-book-website: | ||
needs: build-and-push-image | ||
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: ${{ env.LATEST_IMAGE }} | ||
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: ${{ env.LATEST_IMAGE }} | ||
options: -v ${{ github.workspace }}:/app | ||
run: | | ||
cd /app/book | ||
make printvars | ||
- name: Bake the book | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ${{ env.LATEST_IMAGE }} | ||
options: -v ${{ github.workspace }}:/app | ||
run: | | ||
cd /app/book | ||
make -j bake | ||
- name: Release baked book to S3 | ||
uses: shallwefootball/s3-upload-action@master | ||
with: | ||
aws_key_id: ${{ secrets.AWS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | ||
aws_bucket: ${{ secrets.AWS_BUCKET_BOOK }} | ||
source_dir: book/release | ||
destination_dir: release-recipes | ||
- name: Upload book Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: books | ||
path: | | ||
book/book_serif/book.log | ||
book/book_serif/book.pdf | ||
book/book-epub/book.epub | ||
invalidate-book-cache: | ||
needs: release-book-website | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Invalidate Cloudfront book cache | ||
uses: chetan/invalidate-cloudfront-action@v2 | ||
env: | ||
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_BOOK }} | ||
PATHS: "/*" | ||
AWS_REGION: "us-east-1" | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Test building book | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-building-book: | ||
uses: ./.github/workflows/test-book.yml | ||
with: | ||
docker-image: ghcr.io/${{ github.repository }}:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test book for given image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
docker-image: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-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: ${{ inputs.docker-image }} | ||
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: ${{ inputs.docker-image }} | ||
options: -v ${{ github.workspace }}:/app | ||
run: | | ||
cd /app/book | ||
make printvars | ||
- name: Test baking the book pdf | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ${{ inputs.docker-image }} | ||
options: -v ${{ github.workspace }}:/app | ||
run: | | ||
cd /app/book | ||
make build_serif_pdf build_ebook | ||
- name: Test baking the book epub | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ${{ inputs.docker-image }} | ||
options: -v ${{ github.workspace }}:/app | ||
run: | | ||
cd /app/book | ||
make build_ebook | ||
- name: Upload book Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: books | ||
path: | | ||
book/book_serif/book.log | ||
book/book_serif/book.pdf | ||
book/book-epub/book.epub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.DS_Store | ||
*.xbb | ||
*.aux | ||
*.fdb_latexmk | ||
*.fls | ||
*.log | ||
*.synctex.gz | ||
*.toc | ||
*.bbl | ||
*.bcf | ||
*.blg | ||
*.run.xml | ||
*.html | ||
*.dlog | ||
*.bak | ||
*.opf | ||
book/book.out | ||
.vscode/ | ||
book/bookch* | ||
book/figures/*.png | ||
book/figures/*.pdf | ||
book/figures/*.in | ||
book/book*.4ct | ||
book/book*.4tc | ||
book/book*.css | ||
book/book*.dvi | ||
book/book*.idv | ||
book/book*.lg | ||
book/book*.ncx | ||
book/book*.out | ||
book/book*.tmp | ||
book/book*.xref | ||
book/book*.svg | ||
# Directories created during build | ||
book/book_sans_serif/* | ||
book/book_serif/* | ||
book/static_website_html/* | ||
website/static_website_html/* | ||
book/epub/ | ||
book/book-epub/ | ||
book/bw-book-epub/* | ||
book/release/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
FROM debian:trixie | ||
|
||
LABEL "maintainer"="Hendrik Kleinwächter <[email protected]>" | ||
LABEL "repository"="https://github.com/hendricius/the-sourdough-framework-recipes" | ||
LABEL "homepage"="https://github.com/hendricius/the-sourdough-framework-recipes" | ||
LABEL org.opencontainers.image.source="https://github.com/hendricius/the-sourdough-framework-recipes" | ||
|
||
# Print release information if needed | ||
RUN cat /etc/*release* | ||
|
||
# Install base depdendencies | ||
RUN apt-get update && \ | ||
apt-get install --yes -y --no-install-recommends \ | ||
sudo \ | ||
make \ | ||
tidy \ | ||
pandoc \ | ||
zip \ | ||
git \ | ||
wget \ | ||
imagemagick \ | ||
rsync \ | ||
wget \ | ||
perl \ | ||
xzdec \ | ||
# dvisvgm dependencies | ||
build-essential \ | ||
fonts-texgyre \ | ||
fontconfig \ | ||
libfontconfig1 \ | ||
libkpathsea-dev \ | ||
libptexenc-dev \ | ||
libsynctex-dev \ | ||
libx11-dev \ | ||
libxmu-dev \ | ||
libxaw7-dev \ | ||
libxt-dev \ | ||
libxft-dev \ | ||
libwoff-dev | ||
|
||
# Install TeX | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
texlive-full \ | ||
texlive-luatex | ||
|
||
# Compile latest dvisvgm | ||
RUN wget https://github.com/mgieseki/dvisvgm/releases/download/3.1.2/dvisvgm-3.1.2.tar.gz && \ | ||
mv dvisvgm-3.1.2.tar.gz dvisvgm.tar.gz && \ | ||
tar -xzf dvisvgm.tar.gz && \ | ||
cd dvisvgm-* && \ | ||
./configure && \ | ||
make && \ | ||
make install | ||
|
||
# Make sure everything is UTF-8 | ||
RUN echo "export LC_ALL=en_US.UTF-8" >> /root/.bashrc && \ | ||
echo "export LANG=en_US.UTF-8" >> /root/.bashrc | ||
|
||
WORKDIR /root | ||
|
||
CMD ["/bin/bash"] |
Oops, something went wrong.