add empty release pipeline (#722) #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish GH - Pages | |
on: | |
push: | |
branches: [ main, release/v2.2, release/v2.3 ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set Docs Locations | |
id: branch | |
run: | | |
$branchName = "${{ github.ref }}" | |
# refs/heads/ is 11 characters | |
$branchName = $branchName.Substring(11) | |
if($branchName.StartsWith("release/")) | |
{ | |
$branchName = $branchName.Substring(8) | |
} | |
elseif ($branchName -eq "main") | |
{ | |
$branchName = "" | |
} | |
echo "::set-output name=DOCS_LOCATION::$branchName" | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Install chocolatey | |
run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
- name: Install docfx | |
run: choco install docfx | |
- name: Run DocFx | |
run: docfx docfx/docfx.json | |
- name: Upload to GitHub Pages | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docfx/_site | |
destination_dir: ${{ steps.branch.outputs.DOCS_LOCATION }} | |
keep_files: true | |
full_commit_message: Deploy ${{ steps.branch.outputs.DOCS_LOCATION }} to GitHub Pages |