Skip to content

Commit

Permalink
Update workflow file for docfx
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanGreve committed Jul 16, 2024
1 parent ca745a2 commit 2a3ec3e
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,42 @@ on:
push:
branches:
- master
paths:
- AdvancedSystems.Core/**
- AdvancedSystems.Core.Abstractions/**
- docs/**
- .github/workflows/docs.yml
pull_request:
branches:
- master
paths:
- docs/**
- .github/workflows/docs.yml
workflow_dispatch:

jobs:
generate-docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# 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

- name: Setup DocFX
uses: crazy-max/ghaction-chocolatey@v3
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:
args: install docfx
dotnet-version: 8.x

- name: DocFX Build
working-directory: docs
run: docfx .\docfx.json
continue-on-error: false
- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json

- name: Publish
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
force_orphan: true
# Upload entire repository
path: docs/docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 2a3ec3e

Please sign in to comment.