From 7a478b90e1f9add5496d89a0f073d4f4194be3fe Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Thu, 4 Jan 2024 15:35:33 -0700 Subject: [PATCH] Add github page deployment --- .github/build.yml | 17 +++++++++++++++++ .github/workflows/docs.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/build.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/build.yml b/.github/build.yml new file mode 100644 index 0000000..1da30f3 --- /dev/null +++ b/.github/build.yml @@ -0,0 +1,17 @@ +name: Github Actions +on: [push, pull_request] +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - uses: jiro4989/setup-nim-action@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - run: nimble test -y diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..a814077 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,26 @@ +name: docs +on: + push: + branches: + - master +env: + nim-version: 'stable' + nim-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 }}