Skip to content

Commit 6791f8f

Browse files
committed
feat: add docs publish
1 parent 99abe3c commit 6791f8f

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy to GitHub pages
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- 'hikage-core/src/**'
9+
- 'hikage-extension/src/**'
10+
- 'hikage-extension-betterandroid/src/**'
11+
- 'hikage-extension-compose/src/**'
12+
- 'docs-source/**'
13+
- '.github/workflows/**'
14+
15+
permissions:
16+
contents: write
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
docs:
22+
if: ${{ success() }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 18
32+
- name: Prepare Java 17
33+
uses: actions/setup-java@v4
34+
with:
35+
java-version: 17
36+
java-package: jdk
37+
distribution: 'temurin'
38+
cache: 'gradle'
39+
- name: Cache Gradle Dependencies
40+
uses: actions/cache@v3
41+
with:
42+
path: |
43+
~/.gradle/caches
44+
~/.gradle/wrapper
45+
!~/.gradle/caches/build-cache-*
46+
key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }}
47+
restore-keys: |
48+
gradle-deps
49+
- name: Build VuePress site
50+
run: |
51+
cd docs-source
52+
yarn -i
53+
yarn docs:build-gh-pages
54+
- name: Deploy to GitHub Pages
55+
uses: crazy-max/ghaction-github-pages@v4
56+
with:
57+
target_branch: gh-pages
58+
build_dir: docs-source/dist
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)