Skip to content

Commit

Permalink
Workflow: Add documentation in gh-pages (#126)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Miran <[email protected]>
  • Loading branch information
3 people authored May 17, 2023
1 parent d333331 commit e45b513
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
nim-version:
- '1.4.8'
- '1.6.10'
- '1.6.12'
- 'devel'
needs: before
steps:
Expand All @@ -28,3 +28,30 @@ jobs:
- run: nimble install -y
- run: nimble test
- run: nimble checkExamples

name: docs
on:
push:
branches:
- master
env:
nim-version: 'stable'
nim-src: src/${{ github.event.repository.name }}.nim
deploy-dir: .gh-pages
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.nim-version }}
- run: nimble install -Y
- run: nimble doc --index:on --project --git.url:https://github.com/${{ github.repository }} --git.commit:master --out:${{ env.deploy-dir }} ${{ env.nim-src }}
- name: "Copy to index.html"
run: cp ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html
- name: Deploy documents
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.deploy-dir }}

0 comments on commit e45b513

Please sign in to comment.