From 9dcd6c50841aac5c8c0e884e4ad7ddbd5249cf91 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Wed, 25 Jun 2025 19:10:03 +0800 Subject: [PATCH] chore: add docs publish --- .github/workflows/docs-deploy.yml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/docs-deploy.yml diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 0000000..0600c7d --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,58 @@ +name: Deploy to GitHub pages + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'kavaref-core/src/**' + - 'kavaref-extension/src/**' + - 'docs-source/**' + - '.github/workflows/**' + +permissions: + contents: write + pages: write + id-token: write + +jobs: + docs: + if: ${{ success() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Prepare Java 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + java-package: jdk + distribution: 'temurin' + cache: 'gradle' + - name: Cache Gradle Dependencies + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + !~/.gradle/caches/build-cache-* + key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }} + restore-keys: | + gradle-deps + - name: Build VuePress site + run: | + cd docs-source + yarn -i + yarn docs:build-gh-pages + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + target_branch: gh-pages + build_dir: docs-source/dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file