From 50d83a351a2bd9d67b47e6e30843fa748fc607c0 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sat, 4 Jan 2020 00:41:22 -0600 Subject: [PATCH] Fix 5 actions doc gen --- .github/workflows/docs.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0dfa086b..6d135795 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,6 +34,12 @@ jobs: uses: crazy-max/ghaction-chocolatey@v1 with: args: install docfx -y + - name: Checkout current pages + uses: actions/checkout@v2 + with: + ref: gh-pages + token: ${{ secrets.pagesCommitToken }} + path: docs/${{ env.ORIGIN_SITE }} - name: Build docs shell: powershell working-directory: ./docs @@ -43,12 +49,8 @@ jobs: if ($lastexitcode -ne 0){ throw [System.Exception] "docfx build failed with exit code $lastexitcode." } - - name: Checkout current pages - uses: actions/checkout@v2 - with: - ref: gh-pages - token: ${{ secrets.pagesCommitToken }} - path: docs/${{ env.ORIGIN_SITE }} + + Get-ChildItem - name: Publish master site to GitHub pages shell: powershell working-directory: ./docs @@ -70,10 +72,15 @@ jobs: shell: powershell working-directory: ./docs/${{ env.ORIGIN_SITE }} run: | - if (-Not (Test-Path $env:BRANCH_DIR)) - { New-Item -ItemType directory -Path $env:BRANCH_DIR } + $ErrorActionPreference = "Continue" - $branchName = (git rev-parse --abbrev-ref $env:GITHUB_REF) -join "" + Get-ChildItem .. + + if (-Not (Test-Path $env:BRANCH_DIR)) { + New-Item -ItemType directory -Path $env:BRANCH_DIR + } + + $branchName = (git rev-parse --prefix .. --abbrev-ref=loose $env:GITHUB_REF) -join "" $branchPath = "$env:BRANCH_DIR/$branchName" if (Test-Path $branchPath) { @@ -85,7 +92,6 @@ 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"