Skip to content

Commit 29f3f00

Browse files
authored
Refactor GitHub Actions workflow for documentation
1 parent d1c1224 commit 29f3f00

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/docs.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
- main
88
env:
99
nim-version: 'stable'
10-
nim-src: src/${{ github.event.repository.name }}.nim
10+
module-name: 'libevent'
11+
nim-src: src/${{ env.module-name }}.nim
1112
deploy-dir: .gh-pages
1213
jobs:
1314
docs:
@@ -21,16 +22,13 @@ jobs:
2122
- run: nim doc --index:on --project --path:. --out:${{ env.deploy-dir }} ${{ env.nim-src }}
2223

2324
- name: "Rename to index.html"
24-
run: mv ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html
25+
run: mv ${{ env.deploy-dir }}/${{ env.module-name }}.html ${{ env.deploy-dir }}/index.html
2526

2627
- name: "Find and replace (index.html)"
27-
run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/index.html
28-
29-
# - name: "Find and replace (idx)"
30-
# run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/${{ github.event.repository.name }}.idx
31-
28+
run: sed -i 's/${{ env.module-name }}.html/index.html/g' ${{ env.deploy-dir }}/index.html
29+
3230
- name: "Find and replace (theindex.html)"
33-
run: sed -i 's/${{ github.event.repository.name }}.html/index.html/g' ${{ env.deploy-dir }}/theindex.html
31+
run: sed -i 's/${{ env.module-name }}.html/index.html/g' ${{ env.deploy-dir }}/theindex.html
3432

3533
- name: Deploy documents
3634
uses: peaceiris/actions-gh-pages@v3

0 commit comments

Comments
 (0)