Skip to content

fix(ci): documentation generation on on-release.yml workflow #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ on:
workflow_dispatch: {}
jobs:
publish:
#########################
# Force Github action to run only a single job at a time (based on the group name)
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages` (#365)
#########################
concurrency:
group: on-release-publish
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PUBLISH_TOKEN }}
fetch-depth: 0
#########################
# Release new version
#########################
#########################
# Release new version
#########################
- name: "Use NodeJS 14"
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -46,9 +51,9 @@ jobs:
npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --force-publish=* --yes
fi
npx lerna publish from-git --no-verify-access --yes
#########################
# Generate documentation
#########################
#########################
# Generate documentation
#########################
- name: Set up Python
uses: actions/setup-python@v2.3.1
with:
Expand All @@ -73,6 +78,10 @@ jobs:
echo "Publishing doc for version: $VERSION"
mkdocs build
mike deploy --push --update-aliases --no-redirect "$VERSION" "$ALIAS"
# Once we have agreed on release process, we will also use "main"
# to track the development version (on main branch).
# For now, we make it the same as the latest version.
mike deploy --push --update-aliases --no-redirect "main" "$ALIAS"
# Set latest version as a default
mike set-default --push latest
- name: Build API docs
Expand Down