-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (47 loc) · 1.57 KB
/
docs.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
name: docs
on:
# 每当 push 到 main 分支时触发部署
push:
branches: [dev]
# 手动触发部署
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout this
# @see https://github.com/actions/checkout
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.ID_MOBILE_ROBOT_CORE }}
submodules: true # Fetch private submodules
- name: remove core docs
run: rm -rf core/docs/core
- name: Contribute List
# @see https://github.com/marketplace/actions/contribute-list
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
use_username: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
- name: Build VuePress site
run: yarn docs:build
- name: Deploy to GitHub Pages
# @see https://github.com/crazy-max/ghaction-github-pages
uses: crazy-max/ghaction-github-pages@v2
with:
# 部署到 docs 分支
target_branch: docs
# 部署目录为 VuePress 的默认输出目录
build_dir: core/docs/.vuepress/dist
env:
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}