Browse Source

Set ErrorActionPreference

4.0.0-beta
Anairkoen Schno 5 years ago
parent
commit
612363904c
1 changed files with 7 additions and 10 deletions
  1. +7
    -10
      .github/workflows/docs.yml

+ 7
- 10
.github/workflows/docs.yml View File

@ -24,11 +24,6 @@ jobs:
uses: actions/checkout@v2
- name: Checkout submodules
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
uses: warrenbuckley/Setup-MSBuild@v1
- name: Setup Nuget
@ -48,7 +43,6 @@ jobs:
if ($lastexitcode -ne 0){
throw [System.Exception] "docfx build failed with exit code $lastexitcode."
}
echo $env:BRANCH_NAME
- name: Checkout current pages
uses: actions/checkout@v2
with:
@ -64,13 +58,14 @@ jobs:
Move-Item "$env:ORIGIN_SITE/$env:BRANCH_DIR" _site
cd _site
$ErrorActionPreference = "SilentlyContinue"
git add -A 2>&1
$srcMessage = (git show -s --format=%B $env:GITHUB_SHA) -join "`n"
git commit -q -a -m "Generated Docs -- $srcMessage"
git push -q origin gh-pages
if: env.BRANCH_NAME == 'master'
if: github.ref == 'refs/heads/master'
- name: Publish branch site to GitHub pages
shell: powershell
working-directory: ./docs/${{ env.ORIGIN_SITE }}
@ -78,7 +73,8 @@ jobs:
if (-Not (Test-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) {
# force remove it
@ -89,10 +85,11 @@ jobs:
# move generated into place
Move-Item ../_site $branchPath
$ErrorActionPreference = "SilentlyContinue"
git add -A 2>&1
$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
if: env.BRANCH_NAME != 'master'
if: github.ref != 'refs/heads/master'

Loading…
Cancel
Save