Skip to content

Commit 712acad

Browse files
authored
Update ci.yml
1 parent beba334 commit 712acad

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,26 @@ jobs:
4040
mkdocs build
4141
# Custom step to modify HTML files
4242
43-
- name: Duplicate the generated site dir with postprocessing
43+
- name: Duplicate the generated site dir with postprocessing (non-blocking)
4444
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
4652
4753
- name: Deploy to GitHub Pages
4854
run: |
49-
# Initialize gh-pages branch if it doesn't exist
5055
git config --global user.name "GitHub Actions"
5156
git config --global user.email "actions@github.com"
5257
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
5358
git fetch origin gh-pages
5459
git checkout gh-pages || git checkout --orphan gh-pages
5560
ls -lh
5661
git status
57-
58-
# Copy the site content into the current directory
5962
cp -r ../site_postprocessed/* .
60-
61-
# Commit and push the changes
6263
git add .
6364
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

0 commit comments

Comments
 (0)