Skip to content

Commit d476a89

Browse files
authored
Fix triggers in Action to publish docs (#156)
2 parents 5738f9f + 37250d2 commit d476a89

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,24 @@ on:
1414
paths:
1515
- 'docs/**'
1616

17+
env:
18+
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
19+
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}
20+
1721
jobs:
1822
build-n-publish:
1923
name: Build and publish Docs 📖 to Readthedocs
2024
runs-on: ubuntu-latest
2125

2226
steps:
2327
- 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+
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true
2829
run: |
2930
curl \
3031
-X POST \
3132
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/latest/builds/
3233
- name: When tag 🏷️ pushed - Trigger Readthedocs build
33-
if: github.event_name != 'pull_request'
34-
env:
35-
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
36-
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}
34+
if: github.event_name == 'push' && startsWith(github.ref_name, 'v')
3735
run: |
3836
curl \
3937
-X POST \

0 commit comments

Comments
 (0)