From 049e4f4957c81d27f6970a45c56a5dac8202260c Mon Sep 17 00:00:00 2001 From: Luke Mirman <32971863+Orange-Panda@users.noreply.github.com> Date: Sun, 9 Jun 2024 16:36:27 -0400 Subject: [PATCH] Create docfx-build-publish.yml Create GitHub action for building and publishing DocFX documentation website --- .github/workflows/docfx-build-publish.yml | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/docfx-build-publish.yml diff --git a/.github/workflows/docfx-build-publish.yml b/.github/workflows/docfx-build-publish.yml new file mode 100644 index 0000000..e51ceea --- /dev/null +++ b/.github/workflows/docfx-build-publish.yml @@ -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