Skip to content

Commit

Permalink
update docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Apr 18, 2024
1 parent 4a5b553 commit 87e2748
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 13,804 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fsdocs-tool": {
"version": "14.0.1",
"version": "20.0.0",
"commands": [
"fsdocs"
]
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy-gh-pages

on:
push:
branches: [ main ]
paths:
- 'docs/**'

jobs:
build-and-deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x.x
- name: Restore tools
run: dotnet tool restore
- name: make script executable
run: chmod u+x build.sh
- name: Build example docs
run: ./build.sh buildDocs
- name: deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: ./output # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
3 changes: 1 addition & 2 deletions BioFSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{236C409B-8
docs\03_04_genbank_parsing.fsx = docs\03_04_genbank_parsing.fsx
docs\03_05_obo.fsx = docs\03_05_obo.fsx
docs\03_06_newick.fsx = docs\03_06_newick.fsx
docs\_template.html = docs\_template.html
docs\_template.ipynb = docs\_template.ipynb
docs\NuGet.config = docs\NuGet.config
docs\_template.ipynb = docs\_template.ipynb
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{A5C98CA2-8C64-4684-BF9A-6D76033BF822}"
Expand Down
3 changes: 3 additions & 0 deletions build/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ open BasicTasks
open TestTasks
open PackageTasks
open ReleaseTasks
open DocumentationTasks

DocumentationTasks.watchDocs |> ignore

/// Full release of nuget package, git tag, and documentation for the stable version.
let _release =
Expand Down
51 changes: 51 additions & 0 deletions build/DocumentationTasks.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module DocumentationTasks

open Helpers
open ProjectInfo
open BasicTasks

open BlackFox.Fake

let buildDocs =
BuildTask.create "BuildDocs" [ buildSolution ] {
printfn "building docs with stable version %s" stableVersionTag

runDotNet
(sprintf
"fsdocs build --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
stableVersionTag)
"./"
}

let buildDocsPrerelease =
BuildTask.create "BuildDocsPrerelease" [ setPrereleaseTag; buildSolution ] {
printfn "building docs with prerelease version %s" prereleaseTag

runDotNet
(sprintf
"fsdocs build --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
prereleaseTag)
"./"
}

let watchDocs =
BuildTask.create "WatchDocs" [ buildSolution ] {
printfn "watching docs with stable version %s" stableVersionTag

runDotNet
(sprintf
"fsdocs watch --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
stableVersionTag)
"./"
}

let watchDocsPrerelease =
BuildTask.create "WatchDocsPrerelease" [ setPrereleaseTag; buildSolution ] {
printfn "watching docs with prerelease version %s" prereleaseTag

runDotNet
(sprintf
"fsdocs watch --eval --clean --properties Configuration=Release --parameters fsdocs-package-version %s"
prereleaseTag)
"./"
}
1 change: 1 addition & 0 deletions build/build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<Compile Include="ProjectInfo.fs" />
<Compile Include="BasicTasks.fs" />
<Compile Include="TestTasks.fs" />
<Compile Include="DocumentationTasks.fs" />
<Compile Include="PackageTasks.fs" />
<Compile Include="ReleaseTasks.fs" />
<Compile Include="Build.fs" />
Expand Down
83 changes: 0 additions & 83 deletions docs/_template.html

This file was deleted.

Loading

0 comments on commit 87e2748

Please sign in to comment.