Skip to content

Commit

Permalink
Generate documentation using docfx in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kailash-b committed Sep 30, 2024
1 parent 5432359 commit 05130ab
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
48 changes: 47 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,50 @@ jobs:
project-paths: "['src/Auth0.Core/Auth0.Core.csproj', 'src/Auth0.AuthenticationApi/Auth0.AuthenticationApi.csproj', 'src/Auth0.ManagementApi/Auth0.ManagementApi.csproj']"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

generate-docs:
name: Generate API docs
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install DocFX
run: dotnet tool install -g docfx

- name: Build docs
run: docfx docs-source/docfx.json

- name: Uploading Artifacts
uses: actions/upload-pages-artifact@v2
with:
path: docs

deploy-docs:
needs: generate-docs
name: Deploy API docs
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action
1 change: 0 additions & 1 deletion .shiprc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"build/common.props": [],
".version": []
},
"postbump": "docfx docs-source/docfx.json",
"prefixVersion": false
}
2 changes: 1 addition & 1 deletion docs-source/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": [ "**/*.csproj" ],
"exclude": [ "**/bin/**", "**/obj/**" ],
"cwd": "../src"
"src": "../src"
}
],
"dest": "obj/api"
Expand Down

0 comments on commit 05130ab

Please sign in to comment.