-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (53 loc) · 1.62 KB
/
build-deploy.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
name: Build, Deploy and Release
on:
push:
tags:
- "v*"
pull_request:
branches:
- main
jobs:
build-and-deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# 如果你文档需要 Git 子模块,取消注释下一行
# submodules: true
- name: Setup Yarn
# You may pin to the exact commit or the version.
# uses: DerYeger/yarn-setup-action@f55be5383ea94f5eb25b20aee609af4603a68dde
uses: DerYeger/[email protected]
with:
node-version: 18
- name: Build Docs
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
yarn install
yarn docs:build
echo "do not need it" > docs/.vuepress/dist/.nojekyll
cd ..
- name: Deploy Docs
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
# Branch where docs deploy to
branch: gh-pages
folder: docs/.vuepress/dist
- name: Zip Build
if: github.event_name != 'pull_request'
run: zip -r docs.zip ./docs/.vuepress/dist
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
body: Auto release by Actions.
draft: false
prerelease: false
files: |
docs.zip