@@ -48,23 +48,23 @@ name: sphinx
4848
4949on :
5050 pull_request :
51- paths :
52- - ' .github/actions/sphinx/**'
53- - ' .github/workflows/sphinx.yml'
54- - ' examples/**'
55- - ' sphinx/**'
56- - ' skore/**'
57- push :
58- branches :
59- - main
60- paths :
61- - ' .github/actions/sphinx/**'
62- - ' .github/workflows/sphinx.yml'
63- - ' examples/**'
64- - ' sphinx/**'
65- - ' skore/**'
66- release :
67- types : [released]
51+ # paths:
52+ # - '.github/actions/sphinx/**'
53+ # - '.github/workflows/sphinx.yml'
54+ # - 'examples/**'
55+ # - 'sphinx/**'
56+ # - 'skore/**'
57+ # push:
58+ # branches:
59+ # - main
60+ # paths:
61+ # - '.github/actions/sphinx/**'
62+ # - '.github/workflows/sphinx.yml'
63+ # - 'examples/**'
64+ # - 'sphinx/**'
65+ # - 'skore/**'
66+ # release:
67+ # types: [released]
6868
6969concurrency :
7070 group : ${{ github.workflow }}-${{ github.ref }}
@@ -95,47 +95,48 @@ jobs:
9595 echo "SPHINX_RELEASE=${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}"
9696 fi
9797
98- sphinx-build :
99- runs-on : ubuntu-latest
100- needs : sphinx-version
101- steps :
102- - uses : actions/checkout@v4
103- with :
104- lfs : ' true'
105- - uses : actions/setup-python@v5
106- with :
107- python-version : ' 3.12'
108- cache : ' pip'
109- - uses : ./.github/actions/sphinx/build
110- with :
111- SPHINX_VERSION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
112- SPHINX_RELEASE : ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }}
113- - uses : actions/upload-artifact@v4
114- with :
115- name : sphinx-html-artifact
116- path : sphinx/build/html/
98+ # sphinx-build:
99+ # runs-on: ubuntu-latest
100+ # needs: sphinx-version
101+ # steps:
102+ # - uses: actions/checkout@v4
103+ # with:
104+ # lfs: 'true'
105+ # - uses: actions/setup-python@v5
106+ # with:
107+ # python-version: '3.12'
108+ # cache: 'pip'
109+ # - uses: ./.github/actions/sphinx/build
110+ # with:
111+ # SPHINX_VERSION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
112+ # SPHINX_RELEASE: ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }}
113+ # - uses: actions/upload-artifact@v4
114+ # with:
115+ # name: sphinx-html-artifact
116+ # path: sphinx/build/html/
117117
118118 sphinx-deploy-html :
119- if : ${{ (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
119+ # if: ${{ (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
120120 runs-on : ubuntu-latest
121- needs : [sphinx-version, sphinx-build]
121+ # needs: [sphinx-version, sphinx-build]
122+ needs : [sphinx-version]
122123 steps :
123- - name : Checkout code
124- uses : actions/checkout@v4
125-
126- - name : Download HTML artifacts
127- uses : actions/download-artifact@v4
128- with :
129- name : sphinx-html-artifact
130- path : html/
131-
132- - name : Deploy HTML artifacts
133- uses : ./.github/actions/sphinx/deploy
134- with :
135- CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
136- BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
137- SOURCE : html/
138- DESTINATION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
124+ # - name: Checkout code
125+ # uses: actions/checkout@v4
126+
127+ # - name: Download HTML artifacts
128+ # uses: actions/download-artifact@v4
129+ # with:
130+ # name: sphinx-html-artifact
131+ # path: html/
132+
133+ # - name: Deploy HTML artifacts
134+ # uses: ./.github/actions/sphinx/deploy
135+ # with:
136+ # CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }}
137+ # BUCKET: ${{ vars.DOCUMENTATION_BUCKET }}
138+ # SOURCE: html/
139+ # DESTINATION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
139140
140141 - name : Purge CDN cache
141142 shell : bash
@@ -151,80 +152,80 @@ jobs:
151152 PIPELINE_ID : ${{ vars.DOCUMENTATION_EDGE_SERVICES_PIPELINE_ID }}
152153 ASSET : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
153154
154- sphinx-deploy-root-files :
155- if : ${{ github.event_name == 'release' }}
156- runs-on : ubuntu-latest
157- needs : [sphinx-version, sphinx-build, sphinx-deploy-html]
158- steps :
159- - uses : actions/checkout@v4
160- - shell : python
161- run : |
162- import os
163- import requests
164- import operator
165- import json
166-
167- url = os.environ["URL"]
168- version = os.environ["SPHINX_VERSION"]
169- release = os.environ["SPHINX_RELEASE"]
170-
171- # Retrieve history
172- response = requests.get(f"{url}/versions.json")
173- response.raise_for_status()
174-
175- history = {version["name"]: version["version"] for version in response.json()}
176-
177- # Add new version to history
178- history[version] = release
179-
180- # Sort history, and always keep "dev" at the beginning
181- history = sorted(
182- history.items(),
183- key=lambda item: float(item[0]) if item[0] != "dev" else float('inf'),
184- reverse=True
185- )
186-
187- # Rewrite the history with "dev" and the 10 latest versions
188- new = [
189- {
190- "name": version,
191- "version": release,
192- "url": f"{url}/{version}/",
193- "preferred": i == 1,
194- }
195- for i, (version, release) in enumerate(history[:11])
196- ]
197-
198- os.mkdir("artifacts")
199-
200- with open("artifacts/versions.json", "w", encoding="utf-8") as file:
201- json.dump(new, file, ensure_ascii=False, indent=4)
202-
203- with open("artifacts/index.html", "w", encoding="utf-8") as file:
204- file.write(
205- f"""
206- <head>
207- <meta http-equiv=\"refresh\" content=\"0; url={new[1]["url"]}\"/>
208- </head>
209- """
210- )
211- env :
212- URL : ${{ vars.DOCUMENTATION_URL }}
213- SPHINX_VERSION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
214- SPHINX_RELEASE : ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }}
215- - uses : ./.github/actions/sphinx/deploy
216- with :
217- CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
218- BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
219- ACTION : copy
220- SOURCE : artifacts/
221- DESTINATION :
222-
223- sphinx-clean-artifacts :
224- runs-on : ubuntu-latest
225- if : ${{ always() && (github.event_name != 'pull_request') }}
226- needs : [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files]
227- steps :
228- - uses : geekyeggo/delete-artifact@v5
229- with :
230- name : sphinx-html-artifact
155+ # sphinx-deploy-root-files:
156+ # if: ${{ github.event_name == 'release' }}
157+ # runs-on: ubuntu-latest
158+ # needs: [sphinx-version, sphinx-build, sphinx-deploy-html]
159+ # steps:
160+ # - uses: actions/checkout@v4
161+ # - shell: python
162+ # run: |
163+ # import os
164+ # import requests
165+ # import operator
166+ # import json
167+
168+ # url = os.environ["URL"]
169+ # version = os.environ["SPHINX_VERSION"]
170+ # release = os.environ["SPHINX_RELEASE"]
171+
172+ # # Retrieve history
173+ # response = requests.get(f"{url}/versions.json")
174+ # response.raise_for_status()
175+
176+ # history = {version["name"]: version["version"] for version in response.json()}
177+
178+ # # Add new version to history
179+ # history[version] = release
180+
181+ # # Sort history, and always keep "dev" at the beginning
182+ # history = sorted(
183+ # history.items(),
184+ # key=lambda item: float(item[0]) if item[0] != "dev" else float('inf'),
185+ # reverse=True
186+ # )
187+
188+ # # Rewrite the history with "dev" and the 10 latest versions
189+ # new = [
190+ # {
191+ # "name": version,
192+ # "version": release,
193+ # "url": f"{url}/{version}/",
194+ # "preferred": i == 1,
195+ # }
196+ # for i, (version, release) in enumerate(history[:11])
197+ # ]
198+
199+ # os.mkdir("artifacts")
200+
201+ # with open("artifacts/versions.json", "w", encoding="utf-8") as file:
202+ # json.dump(new, file, ensure_ascii=False, indent=4)
203+
204+ # with open("artifacts/index.html", "w", encoding="utf-8") as file:
205+ # file.write(
206+ # f"""
207+ # <head>
208+ # <meta http-equiv=\"refresh\" content=\"0; url={new[1]["url"]}\"/>
209+ # </head>
210+ # """
211+ # )
212+ # env:
213+ # URL: ${{ vars.DOCUMENTATION_URL }}
214+ # SPHINX_VERSION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
215+ # SPHINX_RELEASE: ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }}
216+ # - uses: ./.github/actions/sphinx/deploy
217+ # with:
218+ # CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }}
219+ # BUCKET: ${{ vars.DOCUMENTATION_BUCKET }}
220+ # ACTION: copy
221+ # SOURCE: artifacts/
222+ # DESTINATION:
223+
224+ # sphinx-clean-artifacts:
225+ # runs-on: ubuntu-latest
226+ # if: ${{ always() && (github.event_name != 'pull_request') }}
227+ # needs: [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files]
228+ # steps:
229+ # - uses: geekyeggo/delete-artifact@v5
230+ # with:
231+ # name: sphinx-html-artifact
0 commit comments