Aragas/Bannerlord.MBOptionScreen

View on GitHub
.github/workflows/docfx.yml

Summary

Maintainability
Test Coverage
name: DocFX

on:
  push:
    branches:
      #- master
      # documentation will cover the dev branch for now.
      - dev
    paths:
      - '.github/workflows/docfx.yml'
      - 'src/MCM/**.cs'
      - 'docs/**'
  workflow_dispatch:

env:
  # Disable the .NET logo in the console output.
  DOTNET_NOLOGO: true
  # Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
  DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
  # Disable sending .NET CLI telemetry to Microsoft.
  DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
  docfx:
    name: DocFX Documentation
    runs-on: ubuntu-latest
    steps:
    - name: DocFX Setup
      uses: butr/actions-docfx-setup@v4
      with:
        github-token: ${{secrets.GITHUB_TOKEN}}

    - name: Build MCM
      run: dotnet build src/MCM/MCM.csproj;
      shell: pwsh

    - name: Run DocFX
      run: >-
        Copy-Item "README.md" -Destination "docs/index.md";
        New-Item -Type dir "docs/images";
        Copy-Item "resources/MCM-48.svg" -Destination "docs/images/MCM-48.svg";
        docfx docs/docfx.json;
      shell: pwsh

    - name: Deploy DocFX
      uses: crazy-max/ghaction-github-pages@v2
      with:
        target_branch: gh-pages
        build_dir: docs/_site
      env:
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}