@@ -14,16 +14,16 @@ jobs:
1414 with :
1515 token : ${{ secrets.GH_PUBLISH_TOKEN }}
1616 fetch-depth : 0
17-
17+ # ########################
18+ # Release new version
19+ # ########################
1820 - name : " Use NodeJS 14"
1921 uses : actions/setup-node@v2
2022 with :
2123 node-version : ' 14'
22-
2324 - name : " Setup npm"
2425 run : |
2526 npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
26-
2727 - name : Install packages
2828 run : |
2929 npm ci
4646 npx lerna version --conventional-commits --conventional-prerelease --preid beta --create-release github --force-publish=* --yes
4747 fi
4848 npx lerna publish from-git --no-verify-access --yes
49+ # ########################
50+ # Generate documentation
51+ # ########################
52+ - name : Set up Python
53+ uses : actions/setup-python@v2.3.1
54+ with :
55+ python-version : ' 3.8'
56+ - name : Set RELEASE_VERSION env var
57+ run : |
58+ RELEASE_VERSION=$(cat packages/commons/package.json | jq '.version' -r)
59+ echo "RELEASE_VERSION=${RELEASE_VERSION:1}" >> $GITHUB_ENV
60+ - name : Install doc generation dependencies
61+ run : |
62+ pip install --upgrade pip
63+ pip install -r docs/requirements.txt
64+ - name : Setup doc deploy
65+ run : |
66+ git config --global user.name Docs deploy
67+ git config --global user.email docs@dummy.bot.com
68+ - name : Build mkdocs site in "gh-pages" branch and push
69+ run : |
70+ rm -rf site
71+ VERSION="$RELEASE_VERSION"
72+ ALIAS="latest"
73+ mkdocs build
74+ mike deploy --push --update-aliases "$VERSION" "$ALIAS"
75+ # Set latest version as a default
76+ mike set-default --push latest
77+ - name : Build API docs
78+ run : |
79+ rm -rf api
80+ npm run docs-generateApiDoc
81+ - name : Release API docs to the released version
82+ uses : peaceiris/actions-gh-pages@v3
83+ with :
84+ github_token : ${{ secrets.GITHUB_TOKEN }}
85+ publish_dir : ./api
86+ keep_files : true
87+ destination_dir : ${{ env.RELEASE_VERSION }}/api
88+ - name : Release API docs to the "latest" version
89+ uses : peaceiris/actions-gh-pages@v3
90+ with :
91+ github_token : ${{ secrets.GITHUB_TOKEN }}
92+ publish_dir : ./api
93+ keep_files : true
94+ destination_dir : latest/api
0 commit comments