Attempt to Publish v2 API to diff url #49
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: Build and publish API docs | |
on: | |
push: | |
branches: [main, develop, v2_develop] | |
permissions: | |
id-token: write | |
pages: write | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
name: Build and Deploy API docs to github-pages | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }}/v2 | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 7.0 | |
dotnet-quality: 'ga' | |
- name: Setup DocFX | |
uses: crazy-max/ghaction-chocolatey@v2 | |
with: | |
args: install docfx | |
- name: DocFX Build | |
working-directory: docfx | |
run: | | |
rm ../docs -Recurse -Force -ErrorAction SilentlyContinue | |
rm ../api -Recurse -Force -ErrorAction SilentlyContinue | |
$env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}" | |
docfx docfx.json | |
continue-on-error: false | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
artifact-name: docs | |
path: docs | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} |