diff --git a/Tools/TGS3Build.ps1 b/Tools/TGS3Build.ps1 index 4fc95b9ad5..40592627d6 100644 --- a/Tools/TGS3Build.ps1 +++ b/Tools/TGS3Build.ps1 @@ -6,9 +6,26 @@ $doxdir = "C:\tgsdox" New-Item -Path $doxdir -ItemType directory +$publish_dox = (-not (Test-Path Env:APPVEYOR_PULL_REQUEST_NUMBER)) -and ("$Env:APPVEYOR_REPO_BRANCH" -eq "master") + +if($publish_dox){ + git clone -b gh-pages --single-branch https://git@github.com/$Env:APPVEYOR_REPO_NAME doxdir + rm -rf "$doxdir\*" +} + Add-Content "$bf\Tools\Doxyfile" "`nPROJECT_NUMBER = $version`nINPUT = $bf`nOUTPUT_DIRECTORY = $doxdir`nPROJECT_LOGO = $bf/tgs.ico" doxygen.exe "$bf\Tools\Doxyfile" +if($publish_dox){ + cd $doxdir + git config --global push.default simple + git config user.name "Appveyor CI" + git config user.email "ci@appveyor.com" + git add --all + git commit -m "Deploy code docs to GitHub Pages for Appveyor build $Env:APPVEYOR_BUILD_NUMBER" -m "Commit: $Env:APPVEYOR_REPO_COMMIT" + git push --force origin gh-pages > /dev/null 2>&1 +} + $destination = "$bf\TGS3-Server-v$version.exe" Move-Item -Path "$src\TG Station Server Installer.exe" -Destination "$destination" diff --git a/appveyor.yml b/appveyor.yml index 63c28fc3e0..1de92fb8ca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,9 @@ pull_requests: branches: except: - gh-pages +environment: + repo_token: + secure: lJNGAXwiB5HlWdthz3K4PetqpTG5IEAyRgKaiKxFMQ8HW8CcOjRtB97B05op7BsK skip_branch_with_pr: true image: Visual Studio 2017 configuration: Release