Skip to content

Commit 8e16f87

Browse files
committed
dynamically select newest version
1 parent 74ab2de commit 8e16f87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/sphinx.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ jobs:
3535
cp docs/source/index.html docs/build/html/index.html
3636
- name: Copy latest version to stable
3737
run: |
38+
# Get the latest version directory dynamically
39+
LATEST_VERSION=$(ls -1 docs/build/html/ | grep '^v[0-9]' | sort -V | tail -1)
40+
echo "Latest version detected: $LATEST_VERSION"
3841
mkdir -p docs/build/html/stable
39-
cp -r docs/build/html/v1.0.21/* docs/build/html/stable
42+
cp -r docs/build/html/$LATEST_VERSION/* docs/build/html/stable/
4043
- name: Deploy docs (all versions + stable alias)
4144
uses: peaceiris/actions-gh-pages@v3
4245
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)