From 2a3ec3e870811659322494673d447c60fec3c05b Mon Sep 17 00:00:00 2001 From: StefanGreve Date: Wed, 17 Jul 2024 00:07:52 +0200 Subject: [PATCH] Update workflow file for docfx --- .github/workflows/docs.yml | 64 ++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 88e4d9b..0b227d7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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