|
@ -24,11 +24,6 @@ jobs: |
|
|
uses: actions/checkout@v2 |
|
|
uses: actions/checkout@v2 |
|
|
- name: Checkout submodules |
|
|
- name: Checkout submodules |
|
|
run: git submodule update --init --recursive |
|
|
run: git submodule update --init --recursive |
|
|
- name: Set branch name variable |
|
|
|
|
|
shell: powershell |
|
|
|
|
|
run: | |
|
|
|
|
|
$env:BRANCH_NAME = (git rev-parse --abbrev-ref $env:GITHUB_REF) -join "" |
|
|
|
|
|
echo $env:BRANCH_NAME |
|
|
|
|
|
- name: Locate MSBuild |
|
|
- name: Locate MSBuild |
|
|
uses: warrenbuckley/Setup-MSBuild@v1 |
|
|
uses: warrenbuckley/Setup-MSBuild@v1 |
|
|
- name: Setup Nuget |
|
|
- name: Setup Nuget |
|
@ -48,7 +43,6 @@ jobs: |
|
|
if ($lastexitcode -ne 0){ |
|
|
if ($lastexitcode -ne 0){ |
|
|
throw [System.Exception] "docfx build failed with exit code $lastexitcode." |
|
|
throw [System.Exception] "docfx build failed with exit code $lastexitcode." |
|
|
} |
|
|
} |
|
|
echo $env:BRANCH_NAME |
|
|
|
|
|
- name: Checkout current pages |
|
|
- name: Checkout current pages |
|
|
uses: actions/checkout@v2 |
|
|
uses: actions/checkout@v2 |
|
|
with: |
|
|
with: |
|
@ -64,13 +58,14 @@ jobs: |
|
|
Move-Item "$env:ORIGIN_SITE/$env:BRANCH_DIR" _site |
|
|
Move-Item "$env:ORIGIN_SITE/$env:BRANCH_DIR" _site |
|
|
|
|
|
|
|
|
cd _site |
|
|
cd _site |
|
|
|
|
|
$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: env.BRANCH_NAME == 'master' |
|
|
|
|
|
|
|
|
if: github.ref == 'refs/heads/master' |
|
|
- name: Publish branch site to GitHub pages |
|
|
- name: Publish branch site to GitHub pages |
|
|
shell: powershell |
|
|
shell: powershell |
|
|
working-directory: ./docs/${{ env.ORIGIN_SITE }} |
|
|
working-directory: ./docs/${{ env.ORIGIN_SITE }} |
|
@ -78,7 +73,8 @@ jobs: |
|
|
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/$env:BRANCH_NAME" |
|
|
|
|
|
|
|
|
$branchName = (git rev-parse --abbrev-ref $env:GITHUB_REF) -join "" |
|
|
|
|
|
$branchPath = "$env:BRANCH_DIR/$branchName" |
|
|
|
|
|
|
|
|
if (Test-Path $branchPath) { |
|
|
if (Test-Path $branchPath) { |
|
|
# force remove it |
|
|
# force remove it |
|
@ -89,10 +85,11 @@ jobs: |
|
|
# move generated into place |
|
|
# move generated into place |
|
|
Move-Item ../_site $branchPath |
|
|
Move-Item ../_site $branchPath |
|
|
|
|
|
|
|
|
|
|
|
$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 ($env:BRANCH_NAME) -- $srcMessage" |
|
|
|
|
|
|
|
|
git commit -q -a -m "Generated Docs ($branchName) -- $srcMessage" |
|
|
|
|
|
|
|
|
git push -q origin gh-pages |
|
|
git push -q origin gh-pages |
|
|
if: env.BRANCH_NAME != 'master' |
|
|
|
|
|
|
|
|
if: github.ref != 'refs/heads/master' |