Skip to content

Commit a088cea

Browse files
Fix Zensical build output handling
Remove unsupported --site-dir flag, inject site_dir into zensical.toml when absent, and assert ../../_site output exists for Pages artifact upload. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent d05fec9 commit a088cea

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/Build-Site.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ jobs:
138138
$docsConfigContent = Get-Content -Path $docsConfigSourcePath -Raw
139139
$docsConfigContent = $docsConfigContent.Replace('-{{ REPO_NAME }}-', $ModuleName)
140140
$docsConfigContent = $docsConfigContent.Replace('-{{ REPO_OWNER }}-', $env:GITHUB_REPOSITORY_OWNER)
141+
if ($docsConfigFileName -eq 'zensical.toml' -and $docsConfigContent -notmatch '(?m)^\s*site_dir\s*=') {
142+
$docsConfigContent = $docsConfigContent -replace '(?m)^\[project\]\s*$', "[project]`nsite_dir = ""../../_site"""
143+
}
141144
$docsConfigContent | Set-Content -Path $docsConfigTargetPath -Force
142145
143146
Write-Host "Build Config Type: $docsConfigFileName"
@@ -159,7 +162,13 @@ jobs:
159162
}
160163
161164
LogGroup 'Build docs - Zensical build' {
162-
zensical build --config-file $configFile --site-dir ../../_site
165+
zensical build --config-file $configFile
166+
}
167+
168+
LogGroup 'Build docs - verify output' {
169+
if (-not (Test-Path -Path '../../_site')) {
170+
throw "Expected Zensical output at ../../_site but it was not created."
171+
}
163172
}
164173
165174
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0

0 commit comments

Comments
 (0)