Skip to content

Commit 2cb31d0

Browse files
committed
Attempt to fix docs publishing script
The problem is that it would have pushed production docs to the production branch. That's no good because the docs are only served from master.
1 parent 4e3ab4c commit 2cb31d0

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Tools/appveyor-publish-docs-site.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ else {
1515
exit 0
1616
}
1717

18+
Write-Host "Switching to a temp branch"
19+
git checkout -b temp/publish-docs
20+
1821
Write-Host "Publishing the docs site to $BaseDir"
1922

2023
Write-Host "Clearing $BaseDir ..."
@@ -51,7 +54,14 @@ git add --all docs/
5154
Write-Host "Creating commit"
5255
git commit -m "Auto-publish docs website [skip ci]"
5356

54-
if($Env:APPVEYOR -eq "True") {
57+
if($Env:APPVEYOR -eq "True" -and $Env:APPVEYOR_REPO_BRANCH -eq "production") {
58+
Write-Host "Pushing to origin"
59+
git checkout master
60+
git pull
61+
git merge temp/publish-docs --no-ff -m "Merge newly-published docs [skip ci]"
62+
git push origin master
63+
}
64+
elseif ($Env:APPVEYOR -eq "True") {
5565
Write-Host "Pushing to origin"
56-
git push origin HEAD:$Env:APPVEYOR_REPO_BRANCH
66+
git push origin temp/publish-docs:master
5767
}

0 commit comments

Comments
 (0)