@@ -19,8 +19,13 @@ name: PR Checks
1919on :
2020 workflow_dispatch :
2121 pull_request :
22+ types : [opened, synchronize, reopened, closed]
2223 branches : [ main ]
2324
25+ concurrency :
26+ group : ${{ github.workflow }}-${{ github.event.pull_request.number }}
27+ cancel-in-progress : true
28+
2429jobs :
2530 # ######################
2631 # Path Filters #
6974 needs : [check-paths]
7075 if : |
7176 (needs.check-paths.outputs.ci == 'true') &&
72- (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true)
77+ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true) &&
78+ (github.event.action != 'closed')
7379 runs-on : ubuntu-latest
7480 steps :
7581 - name : Free disk space
@@ -128,7 +134,8 @@ jobs:
128134 (
129135 needs.check-paths.outputs.ci == 'true' &&
130136 github.event_name == 'pull_request' &&
131- github.event.pull_request.head.repo.fork == false
137+ github.event.pull_request.head.repo.fork == false &&
138+ github.event.action != 'closed'
132139 )
133140 runs-on : self-hosted
134141 environment :
@@ -193,16 +200,29 @@ jobs:
193200 python-version : ' 3.10.18'
194201
195202 - name : Install dependencies
203+ if : github.event.action != 'closed'
196204 run : |
197205 pip install -U -r docs/locked_requirements.txt
198206
199207 - name : Build Sphinx documentation
208+ if : github.event.action != 'closed'
200209 run : |
201210 make -C docs build ERR_DIR=build_error_logs OUT_DIR=public
211+
212+ - name : Deploy preview
213+ uses : rossjrw/pr-preview-action@v1
214+ with :
215+ source-dir : ./docs/public/
216+ preview-branch : gh-pages/documentation
217+
218+ - name : Run spelling and linkcheck
219+ if : github.event.action != 'closed'
220+ run : |
202221 make -C docs spelling ERR_DIR=spelling_error_logs OUT_DIR=public
203222 make -C docs linkcheck ERR_DIR=linkcheck_error_logs OUT_DIR=public
204223
205224 - name : Check for build errors
225+ if : github.event.action != 'closed'
206226 run : |
207227 has_spelling_errors=false
208228 has_linkcheck_errors=false
@@ -229,7 +249,7 @@ jobs:
229249 fi
230250
231251 - name : Upload build artifacts
232- if : always()
252+ if : always() && github.event.action != 'closed'
233253 uses : actions/upload-artifact@v4
234254 with :
235255 name : documentation-build
@@ -245,7 +265,9 @@ jobs:
245265 # ######################
246266 ci-docs :
247267 needs : [check-paths]
248- if : needs.check-paths.outputs.docs == 'true'
268+ if : |
269+ (needs.check-paths.outputs.docs == 'true' && github.event.action != 'closed') ||
270+ github.event_name == 'workflow_dispatch'
249271 runs-on : ubuntu-latest
250272 steps :
251273 - name : Free disk space
@@ -302,7 +324,9 @@ jobs:
302324 # ######################
303325 ui-build :
304326 needs : [check-paths]
305- if : needs.check-paths.outputs.ui == 'true' || github.event_name == 'workflow_dispatch'
327+ if : |
328+ (needs.check-paths.outputs.ui == 'true' && github.event.action != 'closed') ||
329+ github.event_name == 'workflow_dispatch'
306330 runs-on : ubuntu-latest
307331 steps :
308332 - name : Checkout
0 commit comments