Skip to content

Commit 3768581

Browse files
committed
CI: integrate the docs workflow with Generaptor
1 parent 313a0f5 commit 3768581

File tree

7 files changed

+88
-38
lines changed

7 files changed

+88
-38
lines changed

.github/workflows/docs.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
1-
# SPDX-FileCopyrightText: 2024 Friedrich von Never <friedrich@fornever.me>
1+
# SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
22
#
33
# SPDX-License-Identifier: MIT
44

5+
# This file is auto-generated.
56
name: Docs
67
on:
78
push:
89
branches:
9-
- main
10-
workflow_dispatch:
11-
10+
- main
11+
workflow_dispatch:
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
1215
permissions:
1316
actions: read
14-
pages: write
1517
id-token: write
16-
17-
concurrency:
18-
group: "pages"
19-
cancel-in-progress: false
20-
18+
pages: write
2119
jobs:
2220
publish-docs:
2321
environment:
2422
name: github-pages
2523
url: ${{ steps.deployment.outputs.page_url }}
2624
runs-on: ubuntu-24.04
2725
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v6
30-
- name: Dotnet Setup
31-
uses: actions/setup-dotnet@v5
32-
with:
33-
dotnet-version: 8.x
34-
35-
- run: dotnet tool restore
36-
- run: dotnet docfx docs/docfx.json
37-
38-
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v4
40-
with:
41-
path: 'docs/_site'
42-
- name: Deploy to GitHub Pages
43-
id: deployment
44-
uses: actions/deploy-pages@v4
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
- name: Set up .NET SDK
29+
uses: actions/setup-dotnet@v5
30+
with:
31+
dotnet-version: 8.x
32+
- run: dotnet tool restore
33+
- run: dotnet docfx docs/docfx.json
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v4
36+
with:
37+
path: docs/_site
38+
- id: deployment
39+
name: Deploy to GitHub Pages
40+
uses: actions/deploy-pages@v4

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
# This file is auto-generated.
26
name: Main
37
on:

.github/workflows/main.yml.license

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

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
# This file is auto-generated.
26
name: Release
37
on:

.github/workflows/release.yml.license

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

TruePath.sln

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ EndProject
3434
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{55C1E2A5-1630-4C22-A403-65DA2B1B969D}"
3535
ProjectSection(SolutionItems) = preProject
3636
.github\workflows\main.yml = .github\workflows\main.yml
37-
.github\workflows\main.yml.license = .github\workflows\main.yml.license
3837
.github\workflows\release.yml = .github\workflows\release.yml
39-
.github\workflows\release.yml.license = .github\workflows\release.yml.license
4038
.github\workflows\docs.yml = .github\workflows\docs.yml
4139
EndProjectSection
4240
EndProject

scripts/github-actions.fsx

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
// SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
2-
//
3-
// SPDX-License-Identifier: MIT
1+
let licenseHeader = """
2+
# SPDX-FileCopyrightText: 2024-2026 TruePath contributors <https://github.com/ForNeVeR/TruePath>
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
# This file is auto-generated.""".Trim()
47

58
#r "nuget: Generaptor.Library, 1.9.0"
69

@@ -28,6 +31,11 @@ let workflows = [
2831
onWorkflowDispatch
2932
]
3033

34+
let workflow name actions = workflow name [
35+
header licenseHeader
36+
yield! actions
37+
]
38+
3139
workflow "main" [
3240
name "Main"
3341
yield! mainTriggers
@@ -123,6 +131,52 @@ let workflows = [
123131
]
124132
]
125133
]
134+
135+
workflow "docs" [
136+
name "Docs"
137+
onPushTo "main"
138+
onWorkflowDispatch
139+
workflowPermission(PermissionKind.Actions, AccessKind.Read)
140+
workflowPermission(PermissionKind.Pages, AccessKind.Write)
141+
workflowPermission(PermissionKind.IdToken, AccessKind.Write)
142+
workflowConcurrency(
143+
group = "pages",
144+
cancelInProgress = false
145+
)
146+
job "publish-docs" [
147+
environment(name = "github-pages", url = "${{ steps.deployment.outputs.page_url }}")
148+
runsOn "ubuntu-24.04"
149+
step(
150+
name = "Checkout",
151+
usesSpec = Auto "actions/checkout"
152+
)
153+
step(
154+
name = "Set up .NET SDK",
155+
usesSpec = Auto "actions/setup-dotnet",
156+
options = Map.ofList [
157+
"dotnet-version", "8.x"
158+
]
159+
)
160+
step(
161+
run = "dotnet tool restore"
162+
)
163+
step(
164+
run = "dotnet docfx docs/docfx.json"
165+
)
166+
step(
167+
name = "Upload artifact",
168+
usesSpec = Auto "actions/upload-pages-artifact",
169+
options = Map.ofList [
170+
"path", "docs/_site"
171+
]
172+
)
173+
step(
174+
name = "Deploy to GitHub Pages",
175+
id = "deployment",
176+
usesSpec = Auto "actions/deploy-pages"
177+
)
178+
]
179+
]
126180
]
127181

128182
exit <| EntryPoint.Process fsi.CommandLineArgs workflows

0 commit comments

Comments
 (0)