name: Build HTML presentation
on:
push:
branches: [main]
paths:
- presentation-fr.md
- img/**
workflow_dispatch:
jobs:
render:
runs-on: linux-host
steps:
- name: Checkout
run: |
rm -rf work
AUTH_URL=$(echo "$GITHUB_SERVER_URL" | sed -E "s#^(https?)://#\1://x-access-token:${{ secrets.GITHUB_TOKEN }}@#")
git clone --depth 1 "${AUTH_URL}/${GITHUB_REPOSITORY}.git" work
- name: Render presentation-fr.html with Marp
run: |
cd work
/usr/local/bin/marp presentation-fr.md -o presentation-fr.html --html --allow-local-files
- name: Commit and push if changed
run: |
cd work
git config user.email "ci@f1.cyberwild.org"
git config user.name "graft-presentation-ci"
git add presentation-fr.html
if git diff --cached --quiet; then
echo "Nothing to commit"
exit 0
fi
git commit -m "ci: regenerate presentation-fr.html"
git push origin HEAD:main