Skip to content

Commit fcd8ddc

Browse files
committed
.github/workflows/Lucene-Net-Documentation.yml: Fixed copy task to delete andrecreate version directory to ensure that only the docfx content is pushed and stale files and folders are removed. This fixes a subtle copy bug that occurs when the folder doesn't exist that may cause some folders to be copied wrong.
1 parent c554dd6 commit fcd8ddc

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/Lucene-Net-Documentation.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,17 @@ jobs:
195195
path: website-repo
196196

197197
- name: Copy documentation site files
198-
run: Get-ChildItem -Path "$Env:GITHUB_WORKSPACE\main-repo\websites\apidocs\_site" | Copy-Item -Destination "$Env:GITHUB_WORKSPACE\website-repo\docs\$Env:RELEASE_VERSION" -Recurse -Force
198+
run: |
199+
$source = "$Env:GITHUB_WORKSPACE\main-repo\websites\apidocs\_site"
200+
$dest = "$Env:GITHUB_WORKSPACE\website-repo\docs\$Env:RELEASE_VERSION"
201+
202+
if (Test-Path $dest) {
203+
Remove-Item $dest -Recurse -Force
204+
}
205+
206+
New-Item -ItemType Directory -Path $dest -Force | Out-Null
207+
208+
Copy-Item "$source\*" -Destination $dest -Recurse -Force
199209
shell: powershell
200210

201211
# Always push to the same branch based on the CURRENT_TAG (latest version tag)

0 commit comments

Comments
 (0)