Skip to content

Commit

Permalink
Create GitHub Action for building course-notes.pdf (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
btj authored Jan 6, 2025
1 parent dbadc7c commit 190f5ec
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
pull_request:

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container: registry.gitlab.com/islandoftex/images/texlive:TL2024-2025-01-05-medium@sha256:3c51378a5396fefbeb722c347450660e9a9b5539ffbfcf5da13df7c6a22cb0e3

steps:
- uses: actions/checkout@v4

- name: Run a one-line script
shell: bash
run: . ./ci.sh

- uses: actions/[email protected]
with:
path: course-notes.pdf
if-no-files-found: error
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ course-notes.pdf
incrementAges.png
linked_list_sum_recursive.png
language.md
search_tree.png
16 changes: 16 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pushd ..

git clone https://github.com/btj/jlearner
export JLEARNERPATH=`pwd`/jlearner

curl --remote-name https://www.tug.org/fonts/getnonfreefonts/install-getnonfreefonts
texlua install-getnonfreefonts
export PATH=/usr/local/texlive/2024/bin/x86_64-linux:$PATH
getnonfreefonts --sys luximono

apt-get update
apt-get install -y pandoc

popd

. ./make-pdf.sh
2 changes: 1 addition & 1 deletion make-pdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pandoc -o course-notes.html -f gfm \
multi_object_doc_instr.md \
iterators.md \
generics.md
pandoc --wrap=none -V documentclass=book --toc --template=latex.template --listings -o course-notes.tex course-notes.html
pandoc --wrap=none -V documentclass=book -V papersize:a4 --toc --template=latex.template --listings -o course-notes.tex course-notes.html
if [ `uname -s` = Darwin ]; then
SED_IN_PLACE=(-i '')
else
Expand Down

0 comments on commit 190f5ec

Please sign in to comment.