Skip to content

Commit fd0d4b2

Browse files
committed
Add docs deploy action
1 parent 3777388 commit fd0d4b2

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [ "latest" ]
6+
7+
jobs:
8+
docs-build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [16]
13+
java: [21]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v3
17+
with:
18+
version: 8
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: pnpm
24+
- name: Install dependencies
25+
run: cd docs && pnpm install
26+
27+
- name: Set up JDK ${{ matrix.java }}
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: ${{ matrix.java }}
31+
distribution: 'temurin'
32+
- name: Build docs
33+
uses: gradle/actions/setup-gradle@v3
34+
with:
35+
arguments: buildDocs
36+
37+
- name: Clear docs
38+
uses: appleboy/[email protected]
39+
with:
40+
host: ${{ secrets.SSH_HOST }}
41+
username: ${{ secrets.SSH_USERNAME }}
42+
port: ${{ secrets.SSH_PORT }}
43+
key: ${{ secrets.SSH_KEY }}
44+
script: ${{ secrets.DOCS_CLEAR_SCRIPT }}
45+
- name: Upload docs
46+
uses: appleboy/[email protected]
47+
with:
48+
host: ${{ secrets.SSH_HOST }}
49+
username: ${{ secrets.SSH_USERNAME }}
50+
port: ${{ secrets.SSH_PORT }}
51+
key: ${{ secrets.SSH_KEY }}
52+
source: './docs/docs/.vuepress/dist/*'
53+
target: ${{ secrets.DOCS_UPLOAD_PATH }}

0 commit comments

Comments
 (0)