Skip to content

Commit 59d0b8e

Browse files
authored
Add API Documentation Publication to GitHub pages (#524)
1 parent ae07826 commit 59d0b8e

File tree

9 files changed

+145
-0
lines changed

9 files changed

+145
-0
lines changed
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy API Documentation to GitHub Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v3
36+
# Install .NET and DocFx
37+
- name: Setup .NET Core
38+
uses: actions/setup-dotnet@v1
39+
with:
40+
dotnet-version: '7.0.x'
41+
- name: Install docfx
42+
run: dotnet tool update -g docfx
43+
# Build the API docs
44+
- name: Run DocFx
45+
run: docfx docfx_project/docfx.json
46+
# Upload constructed site
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v1
49+
with:
50+
path: 'docfx_project/_site'
51+
# deploy to GitHub Pages
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v2

docfx_project/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
###############
2+
# folder #
3+
###############
4+
/**/DROP/
5+
/**/TEMP/
6+
/**/packages/
7+
/**/bin/
8+
/**/obj/
9+
10+
# Generated site
11+
_site/**

docfx_project/api/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
###############
2+
# temp file #
3+
###############
4+
*.yml
5+
.manifest
6+
7+
# Generated
8+
Microsoft.DevSkim.*.yml

docfx_project/api/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# API Documentation
2+
This site contains the auto generated API documentation for the DevSkim.

docfx_project/articles/intro.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DevSkim API Documentation
2+
This site contains the auto generated API documentation for the DevSkim library components.

docfx_project/articles/toc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Introduction
2+
href: intro.md

docfx_project/docfx.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"files": [
7+
"Microsoft.DevSkim.csproj"
8+
],
9+
"src": "../DevSkim-DotNet/Microsoft.DevSkim"
10+
}
11+
],
12+
"dest": "api",
13+
"includePrivateMembers": false,
14+
"disableGitFeatures": false,
15+
"disableDefaultFilter": false,
16+
"noRestore": false,
17+
"namespaceLayout": "flattened",
18+
"memberLayout": "samePage",
19+
"allowCompilationErrors": false
20+
}
21+
],
22+
"build": {
23+
"content": [
24+
{
25+
"files": [
26+
"api/**.yml",
27+
"api/index.md"
28+
]
29+
},
30+
{
31+
"files": [
32+
"articles/**.md",
33+
"articles/**/toc.yml",
34+
"toc.yml",
35+
"*.md"
36+
]
37+
}
38+
],
39+
"resource": [
40+
{
41+
"files": [
42+
"images/**"
43+
]
44+
}
45+
],
46+
"output": "_site",
47+
"globalMetadataFiles": [],
48+
"fileMetadataFiles": [],
49+
"template": [
50+
"default",
51+
"modern"
52+
],
53+
"postProcessors": [],
54+
"keepFileLink": false,
55+
"disableGitFeatures": false
56+
}
57+
}

docfx_project/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This is the **HOMEPAGE**.
2+
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
3+
## Quick Start Notes:
4+
1. Add images to the *images* folder if the file is referencing an image.

docfx_project/toc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- name: Articles
2+
href: articles/
3+
- name: Api Documentation
4+
href: api/
5+
homepage: api/index.md

0 commit comments

Comments
 (0)