Skip to content

Publish to NuGet + Documentation #182

Publish to NuGet + Documentation

Publish to NuGet + Documentation #182

Workflow file for this run

name: Build, Test, and Deploy Docs
# Trigger
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: read # Allow read access to the repository content
actions: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Setup .NET environment
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
# Install dependencies
- name: Install dependencies
run: dotnet restore
# Build the project
- name: Build project
run: dotnet build --configuration Release --no-restore -warnaserror
# Run unit tests
- name: Run Unit tests
run: dotnet test --no-build --verbosity normal --configuration Release
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4