Skip to content

Commit fae4568

Browse files
hadrien-tomaclaude
andcommitted
fix: use custom BUILD_FOR_GITHUB_PAGES env var
Changed from GITHUB_ACTIONS to BUILD_FOR_GITHUB_PAGES to control baseUrl: - docusaurus.config.ts: Check BUILD_FOR_GITHUB_PAGES instead of GITHUB_ACTIONS - deploy.yml: Set BUILD_FOR_GITHUB_PAGES=true for deployment builds - test.yml: No special env needed, builds with local baseUrl by default This prevents conflicts with the platform GITHUB_ACTIONS variable and ensures tests always use local baseUrl (/) while deployment uses GitHub Pages baseUrl (/docusaurus/). Verified locally: All 69 tests pass (100%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ce52737 commit fae4568

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Build website
3636
run: npm run build
3737
env:
38-
GITHUB_ACTIONS: true
38+
BUILD_FOR_GITHUB_PAGES: true
3939

4040
- name: Upload build artifact
4141
uses: actions/upload-pages-artifact@v3

.github/workflows/test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ jobs:
3131
run: npx playwright install --with-deps
3232

3333
- name: Build Docusaurus
34-
env:
35-
GITHUB_ACTIONS: false
3634
run: npm run build
3735

3836
- name: Run Playwright tests

docusaurus.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type * as Preset from '@docusaurus/preset-classic';
77
// Environment-based configuration
88
// Use '/' for local development, '/docusaurus/' for GitHub Pages
99
const isProduction = process.env.NODE_ENV === 'production';
10-
const isGitHubPages = process.env.GITHUB_ACTIONS === 'true';
10+
// Only use GitHub Pages baseUrl when explicitly building for deployment (not for testing)
11+
const isGitHubPages = process.env.BUILD_FOR_GITHUB_PAGES === 'true';
1112

1213
const config: Config = {
1314
title: 'SophiaHackLab',

0 commit comments

Comments
 (0)