Skip to content

Commit e45b513

Browse files
dlesnoffnarimiran
andauthored
Workflow: Add documentation in gh-pages (#126)
* Update CI nim version * Add guzba's recommended workflow to generate documentation on gh-pages * Reupdate the Nim CI version --------- Co-authored-by: Dimitri LESNOFF <dimitri.lesnoff@lip6.fr> Co-authored-by: Miran <narimiran@disroot.org>
1 parent d333331 commit e45b513

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/test.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
nim-version:
1919
- '1.4.8'
20-
- '1.6.10'
20+
- '1.6.12'
2121
- 'devel'
2222
needs: before
2323
steps:
@@ -28,3 +28,30 @@ jobs:
2828
- run: nimble install -y
2929
- run: nimble test
3030
- run: nimble checkExamples
31+
32+
name: docs
33+
on:
34+
push:
35+
branches:
36+
- master
37+
env:
38+
nim-version: 'stable'
39+
nim-src: src/${{ github.event.repository.name }}.nim
40+
deploy-dir: .gh-pages
41+
jobs:
42+
docs:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
- uses: jiro4989/setup-nim-action@v1
47+
with:
48+
nim-version: ${{ env.nim-version }}
49+
- run: nimble install -Y
50+
- run: nimble doc --index:on --project --git.url:https://github.com/${{ github.repository }} --git.commit:master --out:${{ env.deploy-dir }} ${{ env.nim-src }}
51+
- name: "Copy to index.html"
52+
run: cp ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html
53+
- name: Deploy documents
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: ${{ env.deploy-dir }}

0 commit comments

Comments
 (0)