fix: publish Pages files from repository root

This commit is contained in:
2026-08-31 12:45:25 +09:00
parent 944da34c45
commit 8fa6a18c81
3 changed files with 14 additions and 9 deletions
+12 -7
View File
@@ -24,13 +24,18 @@ try {
throw 'Refusing to update a checkout outside the temporary deployment directory.'
}
$siteTarget = Join-Path $resolvedCheckout 'site'
if (Test-Path -LiteralPath $siteTarget) {
Remove-Item -LiteralPath $siteTarget -Recurse -Force
$oldSiteTarget = Join-Path $resolvedCheckout 'site'
if (Test-Path -LiteralPath $oldSiteTarget) {
Remove-Item -LiteralPath $oldSiteTarget -Recurse -Force
}
New-Item -ItemType Directory -Path $siteTarget | Out-Null
Copy-Item -Path (Join-Path $siteSource '*') -Destination $siteTarget -Recurse -Force
New-Item -ItemType File -Path (Join-Path $siteTarget '.nojekyll') -Force | Out-Null
foreach ($generatedPath in @('assets', 'icons', 'index.html', 'README.txt', 'VERSION.txt', '.nojekyll')) {
$target = Join-Path $resolvedCheckout $generatedPath
if (Test-Path -LiteralPath $target) {
Remove-Item -LiteralPath $target -Recurse -Force
}
}
Copy-Item -Path (Join-Path $siteSource '*') -Destination $resolvedCheckout -Recurse -Force
New-Item -ItemType File -Path (Join-Path $resolvedCheckout '.nojekyll') -Force | Out-Null
$workflowTarget = Join-Path $resolvedCheckout '.github/workflows'
New-Item -ItemType Directory -Path $workflowTarget -Force | Out-Null
@@ -38,7 +43,7 @@ try {
Push-Location $resolvedCheckout
try {
& git add --all -- site .github/workflows/deploy.yml
& git add --all -- site assets icons index.html README.txt VERSION.txt .nojekyll .github/workflows/deploy.yml
if ($LASTEXITCODE -ne 0) { throw 'Failed to stage Pages files.' }
& git diff --cached --quiet
if ($LASTEXITCODE -eq 0) {