Skip to content

Commit

Permalink
Merge pull request #35 from SciNim/addDocs
Browse files Browse the repository at this point in the history
build docs in CI when pushing to master
  • Loading branch information
HugoGranstrom authored Jan 5, 2023
2 parents 5c88d16 + 4edf1f5 commit 9d2f6ab
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Generate numericalnim docs

on:
push:
branches:
- master

jobs:
gen:
name: Generate and deploy docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: iffy/install-nim@v4
- name: Generate
run: |
nimble install -y
nimble docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bin/
.vscode/
*.code-workspace
*.html
docs/
5 changes: 5 additions & 0 deletions numericalnim.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ task test, "Run all tests":
exec "nim c -r tests/test_optimize.nim"
exec "nim c -r tests/test_utils.nim"
exec "nim c -r tests/test_vector.nim"

task docs, "Generate documentation":
# Based on Nico's script
exec "nim doc --project --index:on --git.url:https://github.com/SciNim/numericalnim --git.commit:master --outdir:docs src/numericalnim.nim"
exec "echo \"<meta http-equiv=\\\"Refresh\\\" content=\\\"0; url='theindex.html'\\\" />\" >> docs/index.html"

0 comments on commit 9d2f6ab

Please sign in to comment.