File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 Directory . CreateDirectory ( wwwrootDir ) ;
4242
4343 // Convert Windows paths to Docker-compatible format (forward slashes)
44- var astroPath = Path . Combine ( repoRoot , "astro" ) . Replace ( '\\ ' , '/' ) ;
44+ var repoRootPath = repoRoot . Replace ( '\\ ' , '/' ) ;
4545 var outputPath = wwwrootDir . Replace ( '\\ ' , '/' ) ;
46- var gitPath = Path . Combine ( repoRoot , ".git" ) . Replace ( '\\ ' , '/' ) ;
4746
4847 // Pass GITHUB_TOKEN into the container if set
4948 var githubToken = Environment . GetEnvironmentVariable ( "GITHUB_TOKEN" ) ?? "" ;
5049
5150 // Use Docker to build Astro - consistent across all platforms
5251 // Use Debian-based image (not Alpine) for better compatibility with native modules
5352 // Increase Node.js memory limit to handle large builds
54- // Mount .git so git log works inside the container
53+ // Mount repo root so . git is available for git log
5554 await RunAsync ( "docker" ,
5655 "run --rm " +
57- $ "-v \" { astroPath } :/app/astro \" " +
56+ $ "-v \" { repoRootPath } :/app\" " +
5857 $ "-v \" { outputPath } :/output\" " +
59- $ "-v \" { gitPath } :/app/.git\" " +
6058 "-w /app/astro " +
6159 "-e NODE_OPTIONS=\" --max-old-space-size=8192\" " +
62- "-e GIT_DISCOVERY_ACROSS_FILESYSTEM=1 " +
6360 $ "-e GITHUB_TOKEN=\" { githubToken } \" " +
6461 "node:24-slim " +
6562 "sh -c \" apt-get update && apt-get install -y git && git config --global --add safe.directory /app && npm ci && npm run build && cp -r dist/. /output/\" " ,
You can’t perform that action at this time.
0 commit comments