Skip to content

Commit 183fc9b

Browse files
committed
ODSC-37153. Action to autot-trigger docs build in readthedocs
- added trigger on merge to main changes in docs/ folder
1 parent 6544ca8 commit 183fc9b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/publish-to-readthedocs.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,32 @@ on:
55
push:
66
tags:
77
- 'v*.*.*'
8+
# Auto-trigger this workflow on merge to main changes in docs/** folder
9+
pull_request_target:
10+
types:
11+
- closed
12+
branches:
13+
- main
14+
paths:
15+
- 'docs/**'
816

917
jobs:
1018
build-n-publish:
1119
name: Build and publish Docs 📖 to Readthedocs
1220
runs-on: ubuntu-latest
1321

1422
steps:
15-
- name: Trigger Readthedocs build
23+
- name: When PR ✅ merged - Trigger Readthedocs build
24+
if: github.event.pull_request.merged == true
25+
env:
26+
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
27+
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}
28+
run: |
29+
curl \
30+
-X POST \
31+
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/latest/builds/
32+
- name: When tag 🏷️ pushed - Trigger Readthedocs build
33+
if: github.event_name != 'pull_request'
1634
env:
1735
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
1836
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}

0 commit comments

Comments
 (0)