Skip to content

Commit

Permalink
[setup](build): GitHub Copilot created this from M (#113)
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Hightower <[email protected]>
  • Loading branch information
RalphHightower authored Jan 7, 2025
1 parent 03d9dde commit 0468f03
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/pandoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Pandoc
run: |
sudo apt-get install -y pandoc context
- name: Initialize directories
run: mkdir -p output

- name: Check Pandoc version
id: version
run: |
PANDOC_VERSION=$(pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1)
if [ "$PANDOC_VERSION" -eq "2" ]; then
echo "::set-output name=smart_flag;-smart"
else
echo "::set-output name=smart_flag;--smart"
fi
- name: Build HTML
run: |
for f in markdown/*.md; do
FILE_NAME=$(basename "$f" | sed 's/.md//g')
pandoc --standalone --include-in-header styles/chmduquesne.css \
--lua-filter=pdc-links-target-blank.lua \
--from markdown --to html \
--output output/${FILE_NAME}.html $f \
--metadata pagetitle=$FILE_NAME
done
- name: Build PDF
run: |
for f in markdown/*.md; do
FILE_NAME=$(basename "$f" | sed 's/.md//g')
pandoc --standalone --template styles/chmduquesne.tex \
--from markdown --to context \
--variable papersize=A4 \
--output output/${FILE_NAME}.tex $f
mtxrun --path=output --result=${FILE_NAME}.pdf --script context ${FILE_NAME}.tex
done
- name: Build DOCX
run: |
for f in markdown/*.md; do
FILE_NAME=$(basename "$f" | sed 's/.md//g')
pandoc --standalone ${{ steps.version.outputs.smart_flag }} $f --output output/${FILE_NAME}.docx
done
- name: Build RTF
run: |
for f in markdown/*.md; do
FILE_NAME=$(basename "$f" | sed 's/.md//g')
pandoc --standalone ${{ steps.version.outputs.smart_flag }} $f --output output/${FILE_NAME}.rtf
done
- name: Upload output
uses: actions/upload-artifact@v2
with:
name: output
path: output

0 comments on commit 0468f03

Please sign in to comment.