From 380bc47cd1dc1ea72a5ad5c17308d0560f29cf61 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 7 Feb 2024 17:35:52 +0000 Subject: [PATCH 1/2] .gitlab-ci.yml: Use "public/" folder for pages --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f5edb3804..656c52b42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -189,8 +189,7 @@ pages: artifacts: paths: - - doc/public - publish: doc/public + - public rules: - if: $CI_PIPELINE_SOURCE == "web" && $WEB_SKIP_PAGES == "False" @@ -240,7 +239,7 @@ pages: mkdir -p "$TMPDIR" - | - out="$(readlink -f .)/doc/public" + out="$(readlink -f .)/public" function build_branch() { local branch=$1 -- GitLab From a34bad9bfd27a4696c8e65c9ce7fc148fa70e093 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 7 Feb 2024 18:47:56 +0000 Subject: [PATCH 2/2] .gitlab-ci.yml: Make pages smaller --- .gitlab-ci.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 656c52b42..4c17b42e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -204,7 +204,7 @@ pages: - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update -y - sudo apt-get upgrade -y - - sudo apt-get install software-properties-common -y + - sudo apt-get install software-properties-common symlinks rdfind -y - sudo add-apt-repository ppa:deadsnakes/ppa -y - sudo apt-get update -y - sudo apt-get -y install python3-pip python3.${PYVERSION}-full @@ -257,10 +257,23 @@ pages: audit export LC_ALL=C - cd ./doc && sphinx-build -b html -n --no-color -W --keep-going -T -j auto . "$out/$branch" + local doctree=$(mktemp -d --suffix "-doctree-$branch") + cd ./doc && sphinx-build -b html -n --no-color -W --keep-going -T -j auto -d "$doctree" . "$out/$branch" ) } build_branch main build_branch preview + + # Make the doc a lot more compact by trimming useless files + find "$out" '-(' -name '*.ipynb' -or -name '*.ipynb.txt' '-)' -delete + + # Replace duplicates with symlinks to compact the archive + rdfind -makeresultsfile false -makesymlinks true "$out" + # Rewrite absolute symlinks into relative ones + symlinks -cr "$out" + # TODO: For now the release branch doc won't build as it lacks some necessary fixes # build_branch release + + # Debug excessive sizes + - du -hc "$out" | sort -h -- GitLab