Skip to content

Commit 2e6b9b8

Browse files
committed
Consolidated fsdocs into build.yml
1 parent 90690c2 commit 2e6b9b8

File tree

3 files changed

+26
-46
lines changed

3 files changed

+26
-46
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ jobs:
3838
env:
3939
CI: true
4040

41+
# Upload the static files
42+
- name: Upload documentation
43+
uses: actions/upload-pages-artifact@v2
44+
with:
45+
path: ./output
46+
47+
# GitHub Actions recommends deploying in a separate job.
48+
build-docs:
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v2
55+
4156
analyze:
4257
runs-on: ubuntu-latest
4358
steps:

.github/workflows/docs.yml

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

build/build.fs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ module dotnet =
7171

7272
let analyzers args = DotNet.exec id "fsharp-analyzers" args
7373

74+
let fsdocs args = DotNet.exec id "fsdocs" args
75+
7476
let formatCode _ =
7577
let result = dotnet.fantomas "."
7678

@@ -113,6 +115,12 @@ let analyze _ =
113115

114116
result.Errors |> Seq.iter Trace.traceError)
115117

118+
let generateDocs _ =
119+
[ "build"; "--properties"; $"Configuration=%s{configuration}" ]
120+
|> String.concat " "
121+
|> dotnet.fsdocs
122+
|> failOnBadExitAndPrint
123+
116124
let clean _ =
117125
!! "bin" ++ "src/**/bin" ++ "tests/**/bin" ++ "src/**/obj" ++ "tests/**/obj"
118126
|> Shell.cleanDirs
@@ -258,6 +266,7 @@ let initTargets () =
258266
Target.create "Test" dotnetTest
259267
Target.create "CheckFormat" checkFormatCode
260268
Target.create "Analyze" analyze
269+
Target.create "GenerateDocs" generateDocs
261270
Target.create "AssemblyInfo" generateAssemblyInfo
262271
Target.create "DotnetPack" dotnetPack
263272
Target.create "PublishNuget" publishNuget
@@ -276,12 +285,14 @@ let initTargets () =
276285
// dotnet tools
277286
"Restore" ==>! "Analyze"
278287
"Restore" ==>! "CheckFormat"
288+
"Build" ==>! "GenerateDocs"
279289

280290
// publishing
281291
"AssemblyInfo" ==>! "PublishNuGet"
282292

283293
"Clean"
284294
==> "CheckFormat"
295+
==> "GenerateDocs"
285296
==> "DotnetPack"
286297
==> "PublishNuGet"
287298
==> "GitRelease"

0 commit comments

Comments
 (0)