Skip to content

Commit

Permalink
Create docs.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
georgelemon authored Aug 22, 2023
1 parent 0fd959c commit 42c9364
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: docs
on:
push:
tags:
- '*.*.*'
# branches:
# - main
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: nim doc --index:on --project --path:. --out:${{ env.deploy-dir }} ${{ env.nim-src }}

- name: "Rename to index.html"
run: mv ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html

- name: "Find and replace (index.html)"
run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/index.html

# - name: "Find and replace (idx)"
# run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/${{ github.event.repository.name }}.idx

- name: "Find and replace (theindex.html)"
run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/theindex.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 42c9364

Please sign in to comment.