From 6e2906d9898fffe4edf18d77c10b32f09bcf8233 Mon Sep 17 00:00:00 2001 From: treeform Date: Wed, 10 May 2023 17:35:15 -0700 Subject: [PATCH] Switch to github action doc generator. --- .github/workflows/docs.yml | 26 ++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..683a6b5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,26 @@ +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 }} diff --git a/README.md b/README.md index fc55880..49a332c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![Github Actions](https://github.com/treeform/vmath/workflows/Github%20Actions/badge.svg) -[API reference](https://nimdocs.com/treeform/vmath) +[API reference](https://treeform.github.io/vmath) This library has no dependencies other than the Nim standard library.