Skip to content
Merged
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
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Docs

on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

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

- name: Build
working-directory: docs
run: bun run build
Comment on lines +35 to +37
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The documentation build script in the workflow is missing NODE_ENV=production, causing an incorrect baseUrl to be configured and breaking the deployed site.
Severity: CRITICAL | Confidence: High

πŸ” Detailed Analysis

The GitHub Actions workflow for building documentation executes docusaurus build without setting the NODE_ENV environment variable. According to Docusaurus's build process, process.env.NODE_ENV can be undefined during the initial evaluation of docusaurus.config.ts. This causes the isProd variable in the configuration to become false. Consequently, the baseUrl is incorrectly set to '/' instead of the required '/perry/' for the GitHub Pages deployment. This will result in a non-functional deployed site where all asset paths and internal links are broken.

πŸ’‘ Suggested Fix

In .github/workflows/docs.yml, update the build step to include the NODE_ENV environment variable. Set env: NODE_ENV: production for the step that runs bun run build. This ensures the baseUrl is correctly configured for the production deployment to GitHub Pages.

πŸ€– Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/docs.yml#L35-L37

Potential issue: The GitHub Actions workflow for building documentation executes
`docusaurus build` without setting the `NODE_ENV` environment variable. According to
Docusaurus's build process, `process.env.NODE_ENV` can be `undefined` during the initial
evaluation of `docusaurus.config.ts`. This causes the `isProd` variable in the
configuration to become `false`. Consequently, the `baseUrl` is incorrectly set to `'/'`
instead of the required `'/perry/'` for the GitHub Pages deployment. This will result in
a non-functional deployed site where all asset paths and internal links are broken.

Did we get this right? πŸ‘ / πŸ‘Ž to inform future reviews.
Reference ID: 8303835


- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4