Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build

on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
IN_FILE: opus-iso-binding.md
OUT_FILE_NAME: opus-iso-binding
RUBY_VERSION: 2.7
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: install kramdown
run: sudo gem install kramdown
- name: Convert Markdown to HTML
run: kramdown --template build/html-template ${{ env.IN_FILE }} > ${{ env.OUT_FILE_NAME }}.html
- name: Convert HTML to PDF
run: |
docker run --security-opt seccomp=unconfined \
--rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf --no-cache \
${{ env.OUT_FILE_NAME }}.html ${{ env.OUT_FILE_NAME }}.pdf
- name: Gather deploy files
run: |
mkdir -p deploy
[[ -d images ]] && cp -r images ./deploy/
cp ${{ env.OUT_FILE_NAME }}.html ./deploy/
cp ${{ env.OUT_FILE_NAME }}.pdf ./deploy/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy/
11 changes: 1 addition & 10 deletions build/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,14 @@ outfile='opus-iso-binding'

printf "\nConverting Markdown to HTML ...\n"

kramdown --template html-template ../${infile} | \
# Change image path to parent, and make empty <th> truly empty
sed -e 's/src="images/src="\.\.\/images/g' \
-re 's|<th>\xc2\xa0</th>|<th></th>|g' \
> ${outfile}.html
kramdown --template html-template ../${infile} > ${outfile}.html

printf "\nHTML finished.\n\n"

printf "\nConverting HTML to PDF ...\n\n"

## athenapdf can't handle filesystem paths
cp -r ../images .

docker run --security-opt seccomp=unconfined \
--rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf --no-cache \
${outfile}.html ${outfile}.pdf

rm -rf images

printf "\nPDF finished.\n\n"