Skip to content

docfx

docfx #85

Workflow file for this run

name: GitHub Pages
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
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
# api/toc.yml makes breadcrumb menu weird. waiting for future update.
- name: Generate toc.yml
run: |
cd .docfx
if ! test -f 'toc.yml'; then
echo '- name: API' >> 'toc.yml'
echo ' href: api/toc.yml' >> 'toc.yml'
echo ' expanded: true' >> 'toc.yml'
if test -f '../LICENSE.md'; then
echo '- name: License' >> 'toc.yml'
echo ' href: LICENSE.html' >> 'toc.yml'
if ! [ "$(head -1 ../LICENSE.md | sed -n '/^# /p;q')" ]; then
echo "# $(cat ../LICENSE.md)" > ../LICENSE.md
fi
fi
fi
cd ..
- name: Generate README.md and index.md
run: |
if ! test -f 'README.md'; then
echo "# $(echo ${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/})" > README.md
echo "${{ github.server_url }}/${{ github.repository }}" >> README.md
fi
if ! test -f 'index.md'; then
mv 'README.md' 'index.md'
fi
- run: dotnet tool update -g docfx
- run: docfx .docfx/docfx.json
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: '.docfx/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2