Federated via graft
1.5 kB
45 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 mkdir -p /var/www/graft-presentation/img
29 cp work/presentation-fr.html /var/www/graft-presentation/presentation-fr.html
30 cp work/presentation-fr.html /var/www/graft-presentation/index.html
31 cp work/img/*.jpg /var/www/graft-presentation/img/
32 chmod -R a+rX /var/www/graft-presentation
33
34 - name: Commit and push if changed
35 run: |
36 cd work
37 git config user.email "ci@f1.cyberwild.org"
38 git config user.name "graft-presentation-ci"
39 git add presentation-fr.html
40 if git diff --cached --quiet; then
41 echo "Nothing to commit"
42 exit 0
43 fi
44 git commit -m "ci: regenerate presentation-fr.html"
45 git push origin HEAD:main