Skip to content

Commit 76adfd5

Browse files
authored
Merge pull request #512 from Yang-33/deploy-docs-on-release
Update docs on release
2 parents e74201d + 83aad77 commit 76adfd5

File tree

2 files changed

+37
-45
lines changed

2 files changed

+37
-45
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
release:
44
types: [created]
55
jobs:
6-
build:
6+
release-package:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v4
@@ -16,3 +16,39 @@ jobs:
1616
- run: npm run release
1717
env:
1818
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
19+
20+
deploy-docs:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js 18
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 18
28+
- name: Install Dependency
29+
run: npm ci
30+
- name: Config Internal Git
31+
run: |
32+
git config --global user.email "action@github.com"
33+
git config --global user.name "GitHub Action"
34+
- name: Clone Doc History
35+
uses: actions/checkout@v4
36+
with:
37+
ref: 'gh-pages'
38+
path: 'doc-dist'
39+
- name: Clean Doc Directory
40+
run: |
41+
cd doc-dist
42+
ls | grep -v '.git' | xargs rm -r
43+
cd ../
44+
- name: Build API Docs
45+
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
46+
- name: Build Docs
47+
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
48+
- name: Copy & Deploy
49+
run: |
50+
cp -r docs/.vuepress/dist/* doc-dist/
51+
cd doc-dist
52+
git add -A
53+
git commit -m 'Deploy docs'
54+
git push

0 commit comments

Comments
 (0)