From 7b9ea816a7485da9fe4f100eefb9f981251e7916 Mon Sep 17 00:00:00 2001 From: Tigger Kindel Date: Fri, 1 Dec 2023 14:58:58 -0700 Subject: [PATCH] Attempt to Publish v2 API docs with new workflow --- .github/workflows/api-docs.yml | 55 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index 145aedc0d..0200f29e4 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -2,12 +2,20 @@ name: Build and publish API docs on: push: - branches: [main] + branches: [main, develop, v2_develop] + +permissions: + id-token: write + pages: write jobs: - generate-docs: + # Single deploy job since we're just deploying + deploy: + name: Build and Deploy API docs to gh-pages + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: windows-latest - steps: - name: Checkout uses: actions/checkout@v3 @@ -15,40 +23,35 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.0.3 with: - dotnet-version: 6.0.100 + dotnet-version: 7.0 + dotnet-quality: 'ga' - name: Setup DocFX uses: crazy-max/ghaction-chocolatey@v2 with: args: install docfx - - name: Install dependencies - run: dotnet restore - - name: DocFX Build working-directory: docfx # https://stackoverflow.com/questions/56726429/how-to-run-multiple-commands-in-one-github-actions-docker run: | rm ../docs -Recurse -Force -ErrorAction SilentlyContinue + rm ../api -Recurse -Force -ErrorAction SilentlyContinue + $env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}" docfx docfx.json - continue-on-error: false + continue-on-error: false - - name: Publish - if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs - force_orphan: true - - # - name: Use docfx to build API Docs - # uses: nikeee/docfx-action@v1.0.0 - # with: - # args: docfx/docfx.json - - # # Publish generated site using GitHub Pages - # - uses: maxheld83/ghpages@master - # name: Publish API Documentation on GitHub Pages - # env: - # BUILD_DIR: docs # docfx's default output directory is _site - # GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages \ No newline at end of file + artifact-name: v2_docs + path: v2_docs + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }}