Skip to content

Update docfx build publish trigger #4

Update docfx build publish trigger

Update docfx build publish trigger #4

name: Build and Publish DocFX Website
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
generate-docs:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Run a multi-line script
run: dotnet tool install -g docfx --version 2.75.0
- name: Build DocFX
working-directory: Documentation~
run: docfx docfx.json
continue-on-error: false
- name: Publish to Github Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Documentation~/_site