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