From e4f74c882afcb7c5e8c3a159bee2d6f655732b99 Mon Sep 17 00:00:00 2001 From: toby7002 <144540995+toby7002@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:36:10 +0700 Subject: [PATCH] Add docs building script --- .github/workflows/docs.yml | 53 ++++++++++++++++++++++++++++++++++++++ docs/.vitepress/config.mts | 1 + 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..671797f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,53 @@ +name: Build docs + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v2 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: pnpm + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Install dependencies + run: pnpm i + - name: Build with VitePress + run: | + pnpm docs:build + touch docs/.vitepress/dist/.nojekyll + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: docs/.vitepress/dist + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index f798187..74ab8ad 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -2,6 +2,7 @@ import { defineConfig } from "vitepress"; // https://vitepress.dev/reference/site-config export default defineConfig({ + base: "/" title: "Oh My PMMP", description: "A powerful plugin manager for PocketMine-MP", themeConfig: {