diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..5b7cec5 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,63 @@ +name: Deploy Documentation + +on: + push: + branches: + - master + - main + paths: + - 'docs/**' + - '.github/workflows/deploy-docs.yml' + 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 repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Install documentation dependencies + run: npm ci + working-directory: docs + + - name: Build VitePress documentation + run: npm run build + working-directory: docs + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 8aa787c..205530a 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -3,6 +3,7 @@ import { defineConfig } from 'vitepress'; export default defineConfig({ title: 'BetterCurseForge', description: 'Client mod for CurseForge Launcher', + base: process.env.BASE_URL || '/BetterCurseForge/', appearance: 'dark', lastUpdated: true, cleanUrls: true,