Repository navigation
83 lines (70 loc) · 2.43 KB
/
Copy pathdocs.yml
File metadata and controls
83 lines (70 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Documentation
# The site is rebuilt on every push to main and published to GitHub Pages, so
# the reference can never drift from the code it documents.
#
# One-time setup in the repository: Settings, Pages, Source = GitHub Actions.
on:
push:
branches: [main]
paths:
- 'src/**'
- 'docs/**'
- 'assets/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Never cancel a publish half-way, and never run two at once.
concurrency:
group: pages
cancel-in-progress: false
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# DocFX reads the compiled assemblies and their XML documentation, so the
# projects have to build first. The native library is not needed: nothing
# is executed, only reflected over.
- name: Restore tools
run: dotnet tool restore
# net8.0 explicitly, matching the TargetFramework docfx.json asks for.
# Without it this builds every framework the project declares, which now
# includes an iOS one, and would need the .NET 10 SDK and the iOS workload
# on a runner that has no use for either: the public API is the same on
# both sides, and the reference is generated from the net8.0 assembly.
- name: Build
run: dotnet build src/Box3D.NET/Box3D.NET.csproj --configuration Release --framework net8.0
- name: Generate the icon
shell: pwsh
run: |
# System.Drawing is Windows-only, so on Linux the committed icon is
# used as-is. This step exists to fail loudly if it is missing rather
# than publishing a site with a broken logo.
if (-not (Test-Path assets/icon.png)) {
throw 'assets/icon.png is missing. Run tools/generate-icon.ps1 on Windows and commit it.'
}
- name: Build the site
run: dotnet docfx docs/docfx.json --warningsAsErrors
- uses: actions/upload-pages-artifact@v3
with:
path: docs/_site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4