File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -40,25 +40,26 @@ jobs:
40
40
mkdocs build
41
41
# Custom step to modify HTML files
42
42
43
- - name : Duplicate the generated site dir with postprocessing
43
+ - name : Duplicate the generated site dir with postprocessing (non-blocking)
44
44
run : |
45
- python ./scripts/duplicate_site_with_postprocess.py ./site ../site_postprocessed
45
+ if python ./scripts/duplicate_site_with_postprocess.py ./site ../site_postprocessed; then
46
+ echo "Post-processing OK"
47
+ else
48
+ echo "Post-processing failed, using unprocessed site"
49
+ rm -rf ../site_postprocessed
50
+ cp -r ./site ../site_postprocessed
51
+ fi
46
52
47
53
- name : Deploy to GitHub Pages
48
54
run : |
49
- # Initialize gh-pages branch if it doesn't exist
50
55
git config --global user.name "GitHub Actions"
51
56
git config --global user.email "actions@github.com"
52
57
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
53
58
git fetch origin gh-pages
54
59
git checkout gh-pages || git checkout --orphan gh-pages
55
60
ls -lh
56
61
git status
57
-
58
- # Copy the site content into the current directory
59
62
cp -r ../site_postprocessed/* .
60
-
61
- # Commit and push the changes
62
63
git add .
63
64
git commit -m "Deployed ${GITHUB_SHA} with mkdocs-material v${{ env.MKDOCS_MATERIAL_VERSION }} and HTML post-processing"
64
- git push origin gh-pages --force
65
+ git push origin gh-pages --force
You can’t perform that action at this time.
0 commit comments