File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,22 +46,20 @@ jobs:
4646 - name : Generate coverage report
4747 run : make coverage
4848
49+ - name : Build docs
50+ run : make docs
51+
4952 - name : Checkout gh-pages
5053 uses : actions/checkout@v6
5154 with :
5255 ref : gh-pages
5356 path : gh-pages
5457
55- - name : Generate switcher.json
58+ - name : Update switcher.json
5659 run : |
57- mkdir -p docs/_static
5860 python docs/_scripts/update_switcher.py \
5961 --version "${{ inputs.tag }}" \
6062 --switcher "gh-pages/latest/_static/switcher.json"
61- cp gh-pages/latest/_static/switcher.json docs/_static/switcher.json
62-
63- - name : Build docs
64- run : make docs
6563
6664 - name : Deploy versioned docs
6765 uses : peaceiris/actions-gh-pages@v4
7876 publish_dir : docs/_build/html
7977 destination_dir : latest
8078 keep_files : true
79+
80+ - name : Commit updated switcher.json
81+ run : |
82+ cd gh-pages
83+ git config user.name "github-actions[bot]"
84+ git config user.email "github-actions[bot]@users.noreply.github.com"
85+ git add latest/_static/switcher.json
86+ if git diff --staged --quiet; then
87+ echo "No changes to switcher.json, skipping commit"
88+ else
89+ git commit -m "Update switcher.json for ${{ inputs.tag }}"
90+ git push
91+ fi
Original file line number Diff line number Diff line change 11[
2+ {
3+ "name" : " v0.9.0 (latest)" ,
4+ "version" : " v0.9.0" ,
5+ "url" : " https://ensembl.github.io/ensembl-utils/v0.9.0/"
6+ }
27]
Original file line number Diff line number Diff line change 8282# Define the version and json_url for the version switcher
8383release = ensembl .utils .__version__
8484version_match = f"v{ release } "
85- json_url = "_static/switcher.json"
85+ if os .environ .get ("READTHEDOCS" ) or os .environ .get ("CI" ):
86+ json_url = "https://ensembl.github.io/ensembl-utils/latest/_static/switcher.json"
87+ else :
88+ json_url = "_static/switcher.json"
8689
8790html_theme_options = {
8891 "header_links_before_dropdown" : 4 ,
You can’t perform that action at this time.
0 commit comments