@@ -115,9 +115,40 @@ jobs:
115115 name : sphinx-html-artifact
116116 path : sphinx/build/html/
117117
118- sphinx-deploy-html :
118+ sphinx-preview :
119+ if : ${{ github.event_name == 'pull_request' }}
119120 runs-on : ubuntu-latest
121+ needs : sphinx-build
122+ permissions :
123+ actions : read
124+ contents : read
125+ pull-requests : write
126+ steps :
127+ - uses : actions/checkout@v4
128+
129+ - uses : actions/download-artifact@v4
130+ with :
131+ name : sphinx-html-artifact
132+ path : html/
133+
134+ - uses : ./.github/actions/sphinx/deploy
135+ with :
136+ CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOC_PREVIEW }}
137+ BUCKET : ${{ vars.DOCUMENTATION_PREVIEW_BUCKET }}
138+ SOURCE : html/
139+ DESTINATION : ${{ github.event.number }}/
140+
141+ - uses : marocchino/sticky-pull-request-comment@v2
142+ with :
143+ number : ${{ github.event.number }}
144+ header : documentation-preview
145+ message : >-
146+ [Documentation preview](${{ vars.DOCUMENTATION_PREVIEW_URL }}/${{ github.event.number }})
147+ @ ${{ github.event.pull_request.head.sha }}
148+
149+ sphinx-deploy-html :
120150 if : ${{ (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
151+ runs-on : ubuntu-latest
121152 needs : [sphinx-version, sphinx-build]
122153 steps :
123154 - uses : actions/checkout@v4
@@ -128,12 +159,13 @@ jobs:
128159 - uses : ./.github/actions/sphinx/deploy
129160 with :
130161 CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
162+ BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
131163 SOURCE : html/
132164 DESTINATION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
133165
134166 sphinx-deploy-root-files :
135- runs-on : ubuntu-latest
136167 if : ${{ github.event_name == 'release' }}
168+ runs-on : ubuntu-latest
137169 needs : [sphinx-version, sphinx-build, sphinx-deploy-html]
138170 steps :
139171 - uses : actions/checkout@v4
@@ -144,7 +176,7 @@ jobs:
144176 import operator
145177 import json
146178
147- url = "https://skore.probabl.ai"
179+ url = os.environ["URL"]
148180 current = os.environ["CURRENT"]
149181
150182 response = requests.get(f"{url}/versions.json")
@@ -177,18 +209,20 @@ jobs:
177209 """
178210 )
179211 env :
212+ URL : ${{ vars.DOCUMENTATION_URL }}
180213 CURRENT : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
181214 - uses : ./.github/actions/sphinx/deploy
182215 with :
183216 CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
217+ BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
184218 ACTION : copy
185219 SOURCE : artifacts/
186220 DESTINATION :
187221
188222 sphinx-clean :
189223 runs-on : ubuntu-latest
190224 if : always()
191- needs : [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files]
225+ needs : [sphinx-version, sphinx-build, sphinx-preview, sphinx- deploy-html, sphinx-deploy-root-files]
192226 steps :
193227 - uses : geekyeggo/delete-artifact@v5
194228 with :
0 commit comments