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: {