generated from openpeeps/pistachio
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (43 loc) · 1.33 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: docs
on:
push:
tags:
- '*.*.*'
branches:
- main
paths-ignore:
- LICENSE
- README.*
- examples
- editors
pull_request:
paths-ignore:
- LICENSE
- README.*
- examples
- editors
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 (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 }}