fix: publish Pages files from repository root
This commit is contained in:
@@ -32,7 +32,7 @@ npm run deploy:pages
|
||||
|
||||
1. 공개 데이터 검증과 `pages-dist` 빌드
|
||||
2. 임시 디렉터리에 `DD4SN/DD4SN.github.io` 저장소 복제
|
||||
3. `site/`에 정적 산출물 복사
|
||||
3. 저장소 최상위에 `index.html`, `assets/`, `icons/` 등 정적 산출물 복사
|
||||
4. `.github/workflows/deploy.yml` 갱신
|
||||
5. 배포 저장소의 `main` 브랜치에 산출물 커밋과 푸시
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ jobs:
|
||||
- name: Upload site
|
||||
uses: actions/upload-pages-artifact@v4
|
||||
with:
|
||||
path: site
|
||||
path: .
|
||||
- name: Deploy
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user