Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Deploy Docs

on:
push:
branches: [main]
branches: [main, develop]
paths:
- 'website/**'
- ".github/workflows/deploy-docs.yml"
- "website/**"
workflow_dispatch:

permissions:
Expand All @@ -13,39 +14,52 @@ permissions:
id-token: write

concurrency:
group: pages
cancel-in-progress: false
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure GitHub Pages
id: pages
uses: actions/configure-pages@v5

Comment on lines 22 to +33
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build job sets permissions: contents: read, but it also runs actions/configure-pages@v5. Job-level permissions override the workflow-level pages: write, so configure-pages may fail to read/compute base_path due to missing Pages permission. Consider adding pages: write (or removing the job-level override) for the build job so steps.pages.outputs.base_path is reliably available.

Copilot uses AI. Check for mistakes.
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.38

- name: Install dependencies
working-directory: website
run: bun install
run: bun install --frozen-lockfile

- name: Build docs
working-directory: website
env:
DOCS_BASE: ${{ steps.pages.outputs.base_path }}
DOCS_EDIT_BRANCH: ${{ github.ref_name }}
run: bun run docs:build

- uses: actions/upload-pages-artifact@v3
with:
path: website/.vitepress/dist

deploy:
if: github.ref_name == 'main' || github.ref_name == 'develop'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
7 changes: 0 additions & 7 deletions netlify.toml

This file was deleted.

13 changes: 11 additions & 2 deletions website/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { defineConfig } from 'vitepress'
import { withMermaid } from 'vitepress-plugin-mermaid'

const docsBase = process.env.DOCS_BASE || '/mempalace/'
function normalizeBase(base?: string): string {
if (!base || base === '/') {
return '/'
}

return base.endsWith('/') ? base : `${base}/`
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalizeBase ensures a trailing slash but doesn't enforce a leading slash. VitePress expects base to start and end with /, so a value like mempalace would normalize to mempalace/ and produce broken asset/route URLs. Consider normalizing to always add a leading / when missing (and still ensure trailing /).

Suggested change
return base.endsWith('/') ? base : `${base}/`
const withLeadingSlash = base.startsWith('/') ? base : `/${base}`
return withLeadingSlash.endsWith('/') ? withLeadingSlash : `${withLeadingSlash}/`

Copilot uses AI. Check for mistakes.
}

const docsBase = normalizeBase(process.env.DOCS_BASE || '/mempalace/')
const editBranch = process.env.DOCS_EDIT_BRANCH || 'main'

export default withMermaid(
defineConfig({
Expand Down Expand Up @@ -91,7 +100,7 @@ export default withMermaid(
},

editLink: {
pattern: 'https://github.com/milla-jovovich/mempalace/edit/main/website/:path',
pattern: `https://github.com/milla-jovovich/mempalace/edit/${editBranch}/website/:path`,
text: 'Edit this page on GitHub',
},
},
Expand Down