Skip to content

Commit

Permalink
Create docfx-build-publish.yml
Browse files Browse the repository at this point in the history
Create GitHub action for building and publishing DocFX documentation website
  • Loading branch information
Orange-Panda committed Jun 9, 2024
1 parent bdc40b9 commit 049e4f4
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docfx-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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: [ "dev-docs" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# 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/dev-docs'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Documentation~/_site

0 comments on commit 049e4f4

Please sign in to comment.