Skip to content

Commit 09e1a98

Browse files
committed
ODSC-42785. Add workflow to trigger build/publish docs
- added publish-to-readthedocs.yml
1 parent f88638b commit 09e1a98

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Publish Docs"
2+
3+
on:
4+
# Auto-trigger this workflow on tag creation
5+
push:
6+
tags:
7+
- 'v*.*.*'
8+
9+
env:
10+
RTDS_MLFLOW_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
11+
RTDS_MLFLOW_TOKEN: ${{ secrets.RTDS_MLFLOW_TOKEN }}
12+
13+
jobs:
14+
build-n-publish:
15+
name: Build and publish Docs 📖 to Readthedocs
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: When tag 🏷️ pushed - Trigger Readthedocs build
20+
if: github.event_name == 'push' && startsWith(github.ref_name, 'v')
21+
run: |
22+
# trigger build/publish of latest version
23+
curl \
24+
-X POST \
25+
-H "Authorization: Token $RTDS_MLFLOW_TOKEN" $RTDS_MLFLOW_PROJECT/versions/latest/builds/
26+
# add 15 minutes wait time for readthedocs see freshly created tag
27+
sleep 15m
28+
# trigger build/publish of v*.*.* version
29+
curl \
30+
-X POST \
31+
-H "Authorization: Token $RTDS_MLFLOW_TOKEN" $RTDS_MLFLOW_PROJECT/versions/${{ github.ref_name }}/builds/

0 commit comments

Comments
 (0)