Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions releaseDocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $TEMP_REPO_DIR=[System.IO.Path]::GetFullPath("$psscriptroot/../docs-gh-pages")

$remote_repo="https://github-actions:${TOKEN}@github.com/rws/studio-api-docs.git"

write-host "Cloning the repo $remote_repo with the gh-pages branch"
write-host "==> Cloning the repo $remote_repo with the gh-pages branch"
git clone $remote_repo --branch gh-pages $TEMP_REPO_DIR
Set-Location $TEMP_REPO_DIR

Expand All @@ -26,13 +26,17 @@ if($checkBranch){
git checkout -b gh-pages_temp
$items = Get-ChildItem
$keepVersions = @("15.2", "16.1", "16.2", "17.0", "17.1", "17.2", "18.0", "18.1")
foreach ($item in $items){
if ($item.Name -notin $keepVersions){
git rm $item -r
}
foreach ($item in $items)
{
write-host "==> Checking $($item.Name) for deletion"
if ($item.Name -notin $keepVersions)
{
write-host "==> Deleting $($item.Name)"
git rm $item -r
}
}
write-host "Copy documentation into the repo"

write-host "==>Copy documentation into the repo"
Copy-Item "$SOURCE_DIR\_site\*" .\ -Recurse -force

write-host "Push the new docs to the remote branch"
Expand Down
Loading