-
Notifications
You must be signed in to change notification settings - Fork 154
77 lines (77 loc) · 2.16 KB
/
on-merge-to-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: on-merge-to-main
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PUBLISH_TOKEN }}
fetch-depth: 0
#########################
# Release new version
#########################
- name: "Use NodeJS 14"
uses: actions/setup-node@v2
with:
node-version: '14'
- name: "Setup npm"
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: Install packages
run: |
npm ci
npm run lerna-ci
- name: Run lint
run: npm run lerna-lint
- name: Run tests
run: npm run lerna-test
- name: update release draft
uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#########################
# Generate documentation
#########################
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.8'
- name: Install doc generation dependencies
run: |
pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Build mkdocs site in "gh-pages" branch and push
run: |
rm -rf site
VERSION="dev"
echo "Publishing doc for version: $VERSION"
mkdocs build
mike deploy --push "$VERSION"
- name: Build API docs
run: |
rm -rf api
npm run docs-generateApiDoc
- name: Release API docs to the released version
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: dev/api
- name: Release API docs to the "latest" version
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api
keep_files: true
destination_dir: latest/api