-
Notifications
You must be signed in to change notification settings - Fork 13
42 lines (39 loc) · 1.6 KB
/
docs.yml
File metadata and controls
42 lines (39 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build documentation
on:
push:
tags:
- 'v*.*.*'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: pip install Sphinx m2r2
- name: Checkout repo
uses: actions/checkout@v2
- name: Get incoming tags
run: echo "::set-output name=git-tag::$(git describe --tags --abbrev=0)"
id: get-git-tag
- name: Create a new branch for docs
run: git checkout --orphan docs/${{ steps.get-git-tag.outputs.git-tag }}
- name: Update the docs
run: |
make -C docs api_docs
- name: Setup git agent and commit changes
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/automata-tech/eva_python_sdk
git config --global user.email "docs@automata.tech"
git config --global user.name "docs-bot"
git add .
git commit -m 'docs'
git push origin docs/${{ steps.get-git-tag.outputs.git-tag }} -f
- name: Trigger build of documentation
run: |
curl -X POST -H "Authorization: Token ${{ secrets.RTD_TOKEN }}" https://readthedocs.org/api/v3/projects/eva-python-sdk/versions/docs-${{ steps.get-git-tag.outputs.git-tag }}/builds/
- name: Make new documentation the default version
run: |
curl \
-X PATCH \
-H "Authorization: Token ${{ secrets.RTD_TOKEN }}" https://readthedocs.org/api/v3/projects/eva-python-sdk/ \
-H "Content-Type: application/json" \
-d '{"default_version": "docs-${{ steps.get-git-tag.outputs.git-tag }}"}'