File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -123,5 +123,5 @@ jobs:
123123 path : doc/html
124124
125125 - name : Deploy to GitHub Pages (jll63)
126- if : matrix.os == 'ubuntu-latest' && github.repository_owner == 'jll63' && github.ref_name == 'feature/doc'
126+ if : matrix.os == 'ubuntu-latest' && github.repository_owner == 'jll63'
127127 uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 1111
1212set -e
1313
14+
1415if [ $# -eq 0 ]
1516 then
1617 echo " No playbook supplied, using default playbook"
2223SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
2324cd " $SCRIPT_DIR "
2425
26+ if [ -n " ${CIRCLE_REPOSITORY_URL:- } " ]; then
27+ account=" ${CIRCLE_REPOSITORY_URL#*: } "
28+ account=" ${account%%/* } "
29+ lib=$( basename $( git rev-parse --show-toplevel) )
30+ repository=" ${account} /$lib "
31+ sha=${CIRCLE_SHA1}
32+ elif [ -n " ${GITHUB_REPOSITORY:- } " ]; then
33+ repository=" ${GITHUB_REPOSITORY} "
34+ sha=${GITHUB_SHA}
35+ fi
36+
37+ base_url=" https://github.com/${repository} /blob/${sha} /"
38+
39+ if [ -n " ${base_url} " ]; then
40+ echo " Setting base-url to $base_url "
41+ cp mrdocs.yml mrdocs.yml.bak
42+ perl -i -pe ' s{^\s*base-url:.*$}{base-url: ' " $base_url " ' }' mrdocs.yml
43+ fi
44+
2545echo " Building documentation with Antora..."
2646echo " Installing npm dependencies..."
2747npm ci
@@ -37,4 +57,13 @@ for f in $(find html -name '*.html'); do
3757 perl -i -pe ' s{{{(.*?)}}}{<a href="../../../$1.html">$1</a>}g' " $f "
3858done
3959
60+ if [ -n " ${BASE_URL:- } " ]; then
61+ if [ -f mrdocs.yml.bak ]; then
62+ mv -f mrdocs.yml.bak mrdocs.yml
63+ echo " Restored original mrdocs.yml"
64+ else
65+ echo " mrdocs.yml.bak not found; skipping restore"
66+ fi
67+ fi
68+
4069echo " Done"
You can’t perform that action at this time.
0 commit comments