Skip to content

Commit

Permalink
More fixes to doc-build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Nov 2, 2024
1 parent 15d2b4f commit e90cc8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ jobs:
mathjax_path_to=$(docker exec -e SAGE_USE_CDNS=yes BUILD /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)")
new_version=$(docker exec BUILD cat src/VERSION.txt)
docker cp BUILD:/sage/local/share/doc/sage/html doc/
docker cp BUILD:/sage/local/share/doc/sage/index.html doc/
# Wipe out chronic diffs between old doc and new doc
(cd doc && \
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
Expand Down Expand Up @@ -183,6 +184,10 @@ jobs:
if: (success() || failure()) && steps.docbuild.outcome == 'success'
run: |
set -ex
# Remove any existing html directory before copying a new one
if [ -d "doc/html" ]; then
rm -rf doc/html
fi
# We copy everything to a local folder
docker cp --follow-link BUILD:/sage/local/share/doc/sage/html doc
docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html doc
Expand All @@ -206,7 +211,7 @@ jobs:
# Since HEAD is at commit 'wipe-out', HEAD~1 is commit 'new' (new doc), HEAD~2 is commit 'old' (old doc)
(cd doc && git diff $(git rev-parse HEAD~2) -- "*.html") > diff.txt
# Restore the new doc dropping changes by "wipe out"
(cd doc && git checkout -q -f HEAD~1)
(cd doc && git checkout --quiet -f HEAD~1)
.ci/create-changes-html.sh diff.txt doc
# Sometimes rm -rf .git errors out because of some diehard hidden files
# So we simply move it out of the doc directory
Expand Down

0 comments on commit e90cc8b

Please sign in to comment.