Skip to content

Commit a824168

Browse files
committed
📝 docs: 初始化文档生成和发布流程
- 新增 DocFX 配置文件和 GitHub Actions 工作流 - 创建基本的文档结构和目录 - 设置 API 文档生成和发布到 GitHub Pages - 移除 global.json 文件
1 parent 6d877ca commit a824168

File tree

9 files changed

+127
-5
lines changed

9 files changed

+127
-5
lines changed

.github/workflows/dofx.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: docfx
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
- "master"
7+
- "dev"
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
actions: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in progress and the latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
name: "publish docs"
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
# Check out the branch that triggered this workflow to the 'source' subdirectory
30+
- name: Checkout Code
31+
uses: actions/checkout@v4
32+
- name: Setup .NET SDK
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: |
36+
6.0.x
37+
7.0.x
38+
8.0.x
39+
9.0.x
40+
- name: install dotnet tools
41+
run: |
42+
dotnet tool install -g dotnet-execute
43+
dotnet tool install -g docfx
44+
# Run a build
45+
- name: Build docs
46+
run: |
47+
dotnet-exec info
48+
dotnet build
49+
docfx ./docs/docfx.json
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: 'docs/_site'
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4
57+
# - name: cloudflare-pages
58+
# uses: cloudflare/wrangler-action@v3
59+
# with:
60+
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
61+
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
62+
# command: pages deploy docs/_site --project-name=bing-utils

docs/ReleaseNotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Bing.Utils Release Notes

docs/api/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
###############
2+
# temp file #
3+
###############
4+
*.yml
5+
.manifest

docs/api/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# PLACEHOLDER
2+
3+
TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*!

docs/docfx.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "../src",
8+
"files": [
9+
"**/*.csproj"
10+
]
11+
}
12+
],
13+
"dest": "api"
14+
}
15+
],
16+
"build": {
17+
"content": [
18+
{
19+
"files": [
20+
"**/*.{md,yml}"
21+
],
22+
"exclude": [
23+
"_site/**"
24+
]
25+
}
26+
],
27+
"resource": [
28+
{
29+
"files": [
30+
"**/images/**"
31+
]
32+
}
33+
],
34+
"output": "_site",
35+
"template": [
36+
"default",
37+
"modern"
38+
],
39+
"globalMetadata": {
40+
"_appName": "Bing.Utils",
41+
"_appTitle": "Bing.Utils",
42+
"_enableSearch": true,
43+
"pdf": true
44+
}
45+
}
46+
}

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Bing.Utils

docs/introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Introduction

docs/toc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: 主页
2+
href: index.md
3+
- name: API 文档
4+
href: api/
5+
- name: 发行说明
6+
href: ReleaseNotes.md
7+
- name: Github
8+
href: https://github.com/bing-framework/Bing.Utils

global.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)