@@ -7,56 +7,58 @@ name: Rebuild latest docs
77# 2. Use the latest version released under Releases e.g. v1.22.0
88# 3. Set `Build and publish docs only` field to `true`
99
10-
1110on :
1211 workflow_dispatch :
1312 inputs :
1413 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"
1716 required : true
1817
19-
2018jobs :
2119 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
2224 runs-on : ubuntu-latest
2325 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 aws-devax-open-source@amazon.com
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 aws-devax-open-source@amazon.com
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