Skip to content

Commit

Permalink
Merge branch 'p/38129/fix-livedoc' into p/38220/fix-netlify-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Jun 22, 2024
2 parents d8308d4 + 2d56d27 commit b5ec091
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,39 @@ jobs:
docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html docs
(cd docs && git commit -a -m 'new')
.ci/create-changes-html.sh $(cd docs && git rev-parse HEAD^) docs
# "rm -rf .git" may error out because of some hidden diehard files; hence we just move it out of docs
# Previous "rm -rf .git" sometimes errors out because of some hidden diehard files.
# Hence we simply move it out of docs directory
(cd docs && mv .git ../git)
mv CHANGES.html docs
# Zip everything for increased performance
zip -r docs.zip docs
# We move .git back into docs directory
mv git docs/.git
- name: Upload docs
id: upload
if: (success() || failure()) && steps.copy.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: docs
path: docs.zip

- name: Save space
id: savespace
if: (success() || failure()) && steps.upload.outcome == 'success'
run: |
set -ex
# Save space on runner device before we start to build livedoc
rm -rf docs/
rm -f docs.zip
#
# On release tags: live doc and wheels
#

- name: Build live doc
id: buildlivedoc
if: (success() || failure()) && steps.container.outcome == 'success' && startsWith(github.ref, 'refs/tags/')
if: (success() || failure()) && startsWith(github.ref, 'refs/tags/')
run: |
export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5
export PATH="build/bin:$PATH"
Expand All @@ -215,11 +228,11 @@ jobs:
if: (success() || failure()) && steps.buildlivedoc.outcome == 'success'
run: |
mkdir -p ./livedoc
cp -r -L /sage/local/share/doc/sage/html ./livedoc
cp -r -L /sage/local/share/doc/sage/pdf ./livedoc
cp /sage/local/share/doc/sage/index.html ./livedoc
# We copy everything to a local folder
docker cp --follow-link BUILD:/sage/local/share/doc/sage/html livedoc
docker cp --follow-link BUILD:/sage/local/share/doc/sage/pdf livedoc
docker cp BUILD:/sage/local/share/doc/sage/index.html livedoc
zip -r livedoc.zip livedoc
shell: sh .ci/docker-exec-script.sh BUILD . {0}
- name: Upload live doc
if: (success() || failure()) && steps.copylivedoc.outcome == 'success'
Expand Down

0 comments on commit b5ec091

Please sign in to comment.