@@ -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
@@ -150,80 +151,80 @@ jobs:
150151 TOKEN : ${{ secrets.SCW_SECRET_KEY }}
151152 PIPELINE_ID : ${{ vars.DOCUMENTATION_EDGE_SERVICES_PIPELINE_ID }}
152153
153- sphinx-deploy-root-files :
154- if : ${{ github.event_name == 'release' }}
155- runs-on : ubuntu-latest
156- needs : [sphinx-version, sphinx-build, sphinx-deploy-html]
157- steps :
158- - uses : actions/checkout@v4
159- - shell : python
160- run : |
161- import os
162- import requests
163- import operator
164- import json
165-
166- url = os.environ["URL"]
167- version = os.environ["SPHINX_VERSION"]
168- release = os.environ["SPHINX_RELEASE"]
169-
170- # Retrieve history
171- response = requests.get(f"{url}/versions.json")
172- response.raise_for_status()
173-
174- history = {version["name"]: version["version"] for version in response.json()}
175-
176- # Add new version to history
177- history[version] = release
178-
179- # Sort history, and always keep "dev" at the beginning
180- history = sorted(
181- history.items(),
182- key=lambda item: float(item[0]) if item[0] != "dev" else float('inf'),
183- reverse=True
184- )
185-
186- # Rewrite the history with "dev" and the 10 latest versions
187- new = [
188- {
189- "name": version,
190- "version": release,
191- "url": f"{url}/{version}/",
192- "preferred": i == 1,
193- }
194- for i, (version, release) in enumerate(history[:11])
195- ]
196-
197- os.mkdir("artifacts")
198-
199- with open("artifacts/versions.json", "w", encoding="utf-8") as file:
200- json.dump(new, file, ensure_ascii=False, indent=4)
201-
202- with open("artifacts/index.html", "w", encoding="utf-8") as file:
203- file.write(
204- f"""
205- <head>
206- <meta http-equiv=\"refresh\" content=\"0; url={new[1]["url"]}\"/>
207- </head>
208- """
209- )
210- env :
211- URL : ${{ vars.DOCUMENTATION_URL }}
212- SPHINX_VERSION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
213- SPHINX_RELEASE : ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }}
214- - uses : ./.github/actions/sphinx/deploy
215- with :
216- CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
217- BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
218- ACTION : copy
219- SOURCE : artifacts/
220- DESTINATION :
221-
222- sphinx-clean-artifacts :
223- runs-on : ubuntu-latest
224- if : ${{ always() && (github.event_name != 'pull_request') }}
225- needs : [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files]
226- steps :
227- - uses : geekyeggo/delete-artifact@v5
228- with :
229- name : sphinx-html-artifact
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
0 commit comments