@@ -115,9 +115,41 @@ 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+ recreate : true
146+ message : >-
147+ [Documentation preview](${{ vars.DOCUMENTATION_PREVIEW_URL }}/${{ github.event.number }})
148+ @ commit: ${{ github.event.pull_request.head.sha }}
149+
150+ sphinx-deploy-html :
120151 if : ${{ (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
152+ runs-on : ubuntu-latest
121153 needs : [sphinx-version, sphinx-build]
122154 steps :
123155 - uses : actions/checkout@v4
@@ -128,12 +160,13 @@ jobs:
128160 - uses : ./.github/actions/sphinx/deploy
129161 with :
130162 CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
163+ BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
131164 SOURCE : html/
132165 DESTINATION : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/
133166
134167 sphinx-deploy-root-files :
135- runs-on : ubuntu-latest
136168 if : ${{ github.event_name == 'release' }}
169+ runs-on : ubuntu-latest
137170 needs : [sphinx-version, sphinx-build, sphinx-deploy-html]
138171 steps :
139172 - uses : actions/checkout@v4
@@ -144,7 +177,7 @@ jobs:
144177 import operator
145178 import json
146179
147- url = "https://skore.probabl.ai"
180+ url = os.environ["URL"]
148181 current = os.environ["CURRENT"]
149182
150183 response = requests.get(f"{url}/versions.json")
@@ -177,18 +210,20 @@ jobs:
177210 """
178211 )
179212 env :
213+ URL : ${{ vars.DOCUMENTATION_URL }}
180214 CURRENT : ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}
181215 - uses : ./.github/actions/sphinx/deploy
182216 with :
183217 CONFIGURATION : ${{ secrets.RCLONE_CONFIG_DOCS }}
218+ BUCKET : ${{ vars.DOCUMENTATION_BUCKET }}
184219 ACTION : copy
185220 SOURCE : artifacts/
186221 DESTINATION :
187222
188223 sphinx-clean :
189224 runs-on : ubuntu-latest
190225 if : always()
191- needs : [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files]
226+ needs : [sphinx-version, sphinx-build, sphinx-preview, sphinx- deploy-html, sphinx-deploy-root-files]
192227 steps :
193228 - uses : geekyeggo/delete-artifact@v5
194229 with :
0 commit comments