gitlab-ci: fix test preview feature

This commit is contained in:
Antoine Martin 2024-06-24 12:23:51 -04:00
parent aaf6a6a030
commit 3448fc5785
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -26,16 +26,12 @@ pages:
fi
- rm -rf public/$CURRENT_CONTENT_PATH || true # remove last version of current branch
script:
- | # sed needs to be in its own section
sed -i "s|destdir.*|destdir: ./public/$CURRENT_CONTENT_PATH|" ikiwiki.setup
- ikiwiki --setup ikiwiki.setup
- | # create symbolic link to index.en.html if public/index.html does not exist
if [ ! -L "public/index.html" ]; then
ln -s index.en.html public/index.html
fi
- |
if [ -z "$CURRENT_CONTENT_PATH" ]; then
mv public output
mkdir -p public
mv public public/$CURRENT_CONTENT_PATH
if [ ! -L "public/$CURRENT_CONTENT_PATH/index.html" ]; then
ln -s index.en.html public/$CURRENT_CONTENT_PATH/index.html
fi
- cd public/$EPHEMERAL_BRANCHES_PATH
- tree -d -H '.' -L 1 --noreport --charset utf-8 -T "Versions" -o index.html # generate a root HTML listing all previews for easier access