|
@ -56,14 +56,11 @@ jobs: |
|
|
Move-Item "$env:ORIGIN_SITE/.git" _site |
|
|
Move-Item "$env:ORIGIN_SITE/.git" _site |
|
|
Move-Item "$env:ORIGIN_SITE/$env:TAGS_DIR" _site |
|
|
Move-Item "$env:ORIGIN_SITE/$env:TAGS_DIR" _site |
|
|
Move-Item "$env:ORIGIN_SITE/$env:BRANCH_DIR" _site |
|
|
Move-Item "$env:ORIGIN_SITE/$env:BRANCH_DIR" _site |
|
|
|
|
|
|
|
|
cd _site |
|
|
cd _site |
|
|
$ErrorActionPreference = "SilentlyContinue" |
|
|
$ErrorActionPreference = "SilentlyContinue" |
|
|
git add -A 2>&1 |
|
|
git add -A 2>&1 |
|
|
|
|
|
|
|
|
$srcMessage = (git show -s --format=%B $env:GITHUB_SHA) -join "`n" |
|
|
$srcMessage = (git show -s --format=%B $env:GITHUB_SHA) -join "`n" |
|
|
git commit -q -a -m "Generated Docs -- $srcMessage" |
|
|
git commit -q -a -m "Generated Docs -- $srcMessage" |
|
|
|
|
|
|
|
|
git push -q origin gh-pages |
|
|
git push -q origin gh-pages |
|
|
if: github.ref == 'refs/heads/master' |
|
|
if: github.ref == 'refs/heads/master' |
|
|
- name: Publish branch site to GitHub pages |
|
|
- name: Publish branch site to GitHub pages |
|
@ -71,29 +68,21 @@ jobs: |
|
|
working-directory: ./docs |
|
|
working-directory: ./docs |
|
|
run: | |
|
|
run: | |
|
|
$ErrorActionPreference = "Continue" |
|
|
$ErrorActionPreference = "Continue" |
|
|
|
|
|
|
|
|
$branchName = (git rev-parse --abbrev-ref=loose $env:GITHUB_REF) -join "" |
|
|
$branchName = (git rev-parse --abbrev-ref=loose $env:GITHUB_REF) -join "" |
|
|
$srcMessage = (git show -s --format=%B $env:GITHUB_SHA) -join "`n" |
|
|
$srcMessage = (git show -s --format=%B $env:GITHUB_SHA) -join "`n" |
|
|
|
|
|
|
|
|
cd $env:ORIGIN_SITE |
|
|
cd $env:ORIGIN_SITE |
|
|
|
|
|
|
|
|
if (-Not (Test-Path $env:BRANCH_DIR)) { |
|
|
if (-Not (Test-Path $env:BRANCH_DIR)) { |
|
|
New-Item -ItemType directory -Path $env:BRANCH_DIR |
|
|
New-Item -ItemType directory -Path $env:BRANCH_DIR |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$branchPath = "$env:BRANCH_DIR/$branchName" |
|
|
$branchPath = "$env:BRANCH_DIR/$branchName" |
|
|
if (Test-Path $branchPath) { |
|
|
if (Test-Path $branchPath) { |
|
|
# force remove it |
|
|
# force remove it |
|
|
Get-ChildItem -Path $branchPath -Recurse | Remove-Item -Force -Recurse |
|
|
Get-ChildItem -Path $branchPath -Recurse | Remove-Item -Force -Recurse |
|
|
Remove-Item $branchPath -Force |
|
|
Remove-Item $branchPath -Force |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# move generated into place |
|
|
# move generated into place |
|
|
Move-Item ../_site $branchPath |
|
|
Move-Item ../_site $branchPath |
|
|
|
|
|
|
|
|
git add -A 2>&1 |
|
|
git add -A 2>&1 |
|
|
|
|
|
|
|
|
git commit -q -a -m "Generated Docs ($branchName) -- $srcMessage" |
|
|
git commit -q -a -m "Generated Docs ($branchName) -- $srcMessage" |
|
|
|
|
|
|
|
|
git push -q origin gh-pages |
|
|
git push -q origin gh-pages |
|
|
if: github.ref != 'refs/heads/master' |
|
|
if: github.ref != 'refs/heads/master' |