Federated via graft
1.3 kB
42 lines
1name: Build HTML presentation
2
3on:
4 push:
5 branches: [main]
6 paths:
7 - presentation-fr.md
8 - img/**
9 workflow_dispatch:
10
11jobs:
12 render:
13 runs-on: linux-host
14 steps:
15 - name: Checkout
16 run: |
17 rm -rf work
18 AUTH_URL=$(echo "$GITHUB_SERVER_URL" | sed -E "s#^(https?)://#\1://x-access-token:${{ secrets.GITHUB_TOKEN }}@#")
19 git clone --depth 1 "${AUTH_URL}/${GITHUB_REPOSITORY}.git" work
20
21 - name: Render presentation-fr.html with Marp
22 run: |
23 cd work
24 /usr/local/bin/marp presentation-fr.md -o presentation-fr.html --html --allow-local-files
25
26 - name: Deploy to static server
27 run: |
28 cp work/presentation-fr.html /var/www/graft-presentation/presentation-fr.html
29 cp work/presentation-fr.html /var/www/graft-presentation/index.html
30
31 - name: Commit and push if changed
32 run: |
33 cd work
34 git config user.email "ci@f1.cyberwild.org"
35 git config user.name "graft-presentation-ci"
36 git add presentation-fr.html
37 if git diff --cached --quiet; then
38 echo "Nothing to commit"
39 exit 0
40 fi
41 git commit -m "ci: regenerate presentation-fr.html"
42 git push origin HEAD:main