@@ -7,56 +7,58 @@ name: Rebuild latest docs
7
7
# 2. Use the latest version released under Releases e.g. v1.22.0
8
8
# 3. Set `Build and publish docs only` field to `true`
9
9
10
-
11
10
on :
12
11
workflow_dispatch :
13
12
inputs :
14
13
latest_published_version :
15
- description : ' Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0'
16
- default : ' v1.22.0'
14
+ description : " Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0"
15
+ default : " v1.22.0"
17
16
required : true
18
17
19
-
20
18
jobs :
21
19
release :
20
+ # Force Github action to run only a single job at a time (based on the group name)
21
+ # This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
22
+ concurrency :
23
+ group : on-docs-rebuild
22
24
runs-on : ubuntu-latest
23
25
steps :
24
- - uses : actions/checkout@v3
25
- with :
26
- fetch-depth : 0
27
- - name : Set up Python
28
- uses : actions/setup-python@v4
29
- with :
30
- python-version : " 3.8"
31
- - name : Set release notes tag
32
- run : |
33
- RELEASE_TAG_VERSION=${{ github.event.inputs.latest_published_version }}
34
- echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
35
- - name : Ensure new version is also set in pyproject and CHANGELOG
36
- run : |
37
- grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
38
- grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
39
- - name : Install dependencies
40
- run : make dev
41
- - name : Setup doc deploy
42
- run : |
43
- git config --global user.name Docs deploy
44
- git config --global user.email [email protected]
45
- - name : Build docs website and API reference
46
- run : |
47
- make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
48
- poetry run mike set-default --push latest
49
- - name : Release API docs to release version
50
- uses : peaceiris/actions-gh-pages@v3
51
- with :
52
- github_token : ${{ secrets.GITHUB_TOKEN }}
53
- publish_dir : ./api
54
- keep_files : true
55
- destination_dir : ${{ env.RELEASE_TAG_VERSION }}/api
56
- - name : Release API docs to latest
57
- uses : peaceiris/actions-gh-pages@v3
58
- with :
59
- github_token : ${{ secrets.GITHUB_TOKEN }}
60
- publish_dir : ./api
61
- keep_files : true
62
- destination_dir : latest/api
26
+ - uses : actions/checkout@v3
27
+ with :
28
+ fetch-depth : 0
29
+ - name : Set up Python
30
+ uses : actions/setup-python@v4
31
+ with :
32
+ python-version : " 3.8"
33
+ - name : Set release notes tag
34
+ run : |
35
+ RELEASE_TAG_VERSION=${{ github.event.inputs.latest_published_version }}
36
+ echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
37
+ - name : Ensure new version is also set in pyproject and CHANGELOG
38
+ run : |
39
+ grep --regexp "${RELEASE_TAG_VERSION}" CHANGELOG.md
40
+ grep --regexp "version \= \"${RELEASE_TAG_VERSION}\"" pyproject.toml
41
+ - name : Install dependencies
42
+ run : make dev
43
+ - name : Setup doc deploy
44
+ run : |
45
+ git config --global user.name Docs deploy
46
+ git config --global user.email [email protected]
47
+ - name : Build docs website and API reference
48
+ run : |
49
+ make release-docs VERSION=${RELEASE_TAG_VERSION} ALIAS="latest"
50
+ poetry run mike set-default --push latest
51
+ - name : Release API docs to release version
52
+ uses : peaceiris/actions-gh-pages@v3
53
+ with :
54
+ github_token : ${{ secrets.GITHUB_TOKEN }}
55
+ publish_dir : ./api
56
+ keep_files : true
57
+ destination_dir : ${{ env.RELEASE_TAG_VERSION }}/api
58
+ - name : Release API docs to latest
59
+ uses : peaceiris/actions-gh-pages@v3
60
+ with :
61
+ github_token : ${{ secrets.GITHUB_TOKEN }}
62
+ publish_dir : ./api
63
+ keep_files : true
64
+ destination_dir : latest/api
0 commit comments