2222 - name : Set up environment variables
2323 run : echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
2424
25- # Step 3: Run the Marp command using Docker
26- - name : Generate Marp documentation
25+ # Step 3: Generate Marp documentation
26+ - name : Generate Marp slides
2727 run : |
2828 docker run --rm \
2929 -v $PWD:/home/marp/app/ \
@@ -32,22 +32,26 @@ jobs:
3232 marpteam/marp-cli:v3.2.0 \
3333 --theme talk/theme.css talk/slides.md --html
3434
35+ # Save output for deployment
36+ mkdir -p .deploy
37+ cp talk/slides.html .deploy/index.html
38+ [ -d talk/figures ] && cp -r talk/figures .deploy/figures
39+
3540 # Step 4: Switch to gh-pages branch
3641 - name : Switch to gh-pages branch
3742 run : |
43+ git fetch origin gh-pages || true
3844 git checkout -B gh-pages origin/gh-pages || git checkout --orphan gh-pages
3945 git reset --hard
46+ rm -rf *
4047
41- # Step 5: Deploy to gh-pages branch
42- - name : Deploy to gh-pages branch
48+ # Step 5: Deploy to GitHub Pages
49+ - name : Deploy generated slides
4350 run : |
44- mkdir -p .
45- cp talk/slides.html index.html
46- cp -r talk/figures figures
51+ cp -r .deploy/* .
4752 git add index.html
48- git add talk/slides.html
49- git add -f figures/illustrations/*.png
53+ git add -f figures || true
5054 git config user.name "github-actions[bot]"
5155 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
5256 git commit -m "Deploy Marp slides [skip ci]" || echo "No changes to commit"
53- git push origin gh-pages --force
57+ git push origin gh-pages --force
0 commit comments