Skip to content

Commit 70b2dfa

Browse files
Revert "Merge pull request #43 from Ensembl/jalvarez/fix_docs_deploy"
This reverts commit b7442c7, reversing changes made to 531524f.
1 parent b7442c7 commit 70b2dfa

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

.github/workflows/docs.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff 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
@@ -78,3 +76,16 @@ jobs:
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

docs/_static/switcher.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
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
]

docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@
8282
# Define the version and json_url for the version switcher
8383
release = ensembl.utils.__version__
8484
version_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

8790
html_theme_options = {
8891
"header_links_before_dropdown": 4,

0 commit comments

Comments
 (0)