@@ -48,44 +48,15 @@ jobs:
4848 poetry install --with docs
4949
5050 - name : Test documentation build
51- if : github.event_name == 'pull_request' && github.base_ref == 'dev'
51+ # if: github.event_name == 'pull_request' && github.base_ref == 'dev'
5252 run : |
5353 echo "Testing documentation build for PR..."
54- poetry run sphinx-build docs/source docs/build/html
54+ make test- docs
5555
56- - name : Generate missing tags list
57- # if: github.event_name == 'push' || github.event_name == 'release'
58- id : missing_tags
56+ - name : build multiversion documentation
57+ # if: ${{ github.ref == 'refs/heads/dev' }}
5958 run : |
60- # Fetch existing documentation versions from gh-pages
61- mkdir -p existing_versions
62- git fetch origin gh-pages --depth=1
63- git checkout origin/gh-pages -- versions || true
64-
65- # List existing tags and built versions
66- EXISTING_VERSIONS=$(ls versions | tr '\n' ' ')
67- ALL_TAGS=$(git tag --list "v*" | tr '\n' ' ')
68-
69- # Find missing tags
70- MISSING_TAGS=""
71- for TAG in $ALL_TAGS; do
72- if [[ ! " $EXISTING_VERSIONS " =~ " $TAG " ]]; then
73- MISSING_TAGS+="$TAG "
74- fi
75- done
76-
77- echo "Missing tags: $MISSING_TAGS"
78- echo "missing_tags=${MISSING_TAGS}" >> $GITHUB_ENV
79-
80- - name : Build documentation for missing tags
81- if : env.missing_tags != ''
82- run : |
83- for TAG in ${{ env.missing_tags }}; do
84- echo "Building docs for $TAG..."
85- git checkout $TAG
86- mkdir -p docs/build/versions/$TAG
87- poetry run sphinx-build docs/source docs/build/versions/$TAG
88- done
59+ make multi-version-docs
8960
9061 - name : Build documentation for dev branch
9162 # if: github.ref == 'refs/heads/dev'
@@ -101,36 +72,3 @@ jobs:
10172 publish_dir : docs/build/versions
10273 destination_dir : versions
10374 keep_files : true
104-
105- update-static :
106- name : Update Static Files in Old Releases
107- runs-on : ubuntu-latest
108- needs : build-docs
109-
110- steps :
111- - name : Checkout gh-pages branch
112- uses : actions/checkout@v4
113- with :
114- ref : gh-pages
115- fetch-depth : 0
116-
117- - name : Update _static in all versions
118- run : |
119- # Define path to the updated _static directory
120- UPDATED_STATIC_DIR=versions/dev/_static
121- TARGET_STATIC_DIRS=$(find versions/ -type d -name "_static")
122-
123- # Copy updated _static to all versions
124- for DIR in $TARGET_STATIC_DIRS; do
125- echo "Updating $DIR..."
126- cp -r ${UPDATED_STATIC_DIR}/* ${DIR}/ || true
127- done
128-
129- - name : Commit and push changes
130- run : |
131- git add .
132- git commit -m "Update _static files in all documentation versions" || echo "No changes to commit"
133- git push
134- # with:
135- # github_token: ${{ github.token }}
136-
0 commit comments