Skip to content

Commit bb887fa

Browse files
authored
fix: documentation generation on on-release.yml workflow (#368)
* Limit concurrency of "publish" job to just one to avoid concurrency issue (Issue: #365) * Generate "latest" alias doc instead of just redirect to the latest version (Issue: #367) * Generate main version
1 parent 756f475 commit bb887fa

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Diff for: .github/workflows/on-release.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ on:
66
workflow_dispatch: {}
77
jobs:
88
publish:
9+
#########################
10+
# Force Github action to run only a single job at a time (based on the group name)
11+
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages` (#365)
12+
#########################
13+
concurrency:
14+
group: on-release-publish
915
runs-on: ubuntu-latest
10-
1116
steps:
1217
- name: "Checkout"
1318
uses: actions/checkout@v2
1419
with:
1520
token: ${{ secrets.GH_PUBLISH_TOKEN }}
1621
fetch-depth: 0
17-
#########################
18-
# Release new version
19-
#########################
22+
#########################
23+
# Release new version
24+
#########################
2025
- name: "Use NodeJS 14"
2126
uses: actions/setup-node@v2
2227
with:
@@ -46,9 +51,9 @@ jobs:
4651
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --force-publish=* --yes
4752
fi
4853
npx lerna publish from-git --no-verify-access --yes
49-
#########################
50-
# Generate documentation
51-
#########################
54+
#########################
55+
# Generate documentation
56+
#########################
5257
- name: Set up Python
5358
uses: actions/[email protected]
5459
with:
@@ -73,6 +78,10 @@ jobs:
7378
echo "Publishing doc for version: $VERSION"
7479
mkdocs build
7580
mike deploy --push --update-aliases --no-redirect "$VERSION" "$ALIAS"
81+
# Once we have agreed on release process, we will also use "main"
82+
# to track the development version (on main branch).
83+
# For now, we make it the same as the latest version.
84+
mike deploy --push --update-aliases --no-redirect "main" "$ALIAS"
7685
# Set latest version as a default
7786
mike set-default --push latest
7887
- name: Build API docs

0 commit comments

Comments
 (0)