Skip to content

Commit 0656c92

Browse files
committed
update workflows
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 2e5fb1b commit 0656c92

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/docs.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: docs
22
on:
33
push:
4+
paths-ignore:
5+
- '**.md'
6+
- LICENSE
7+
- README.*
8+
- examples
49
tags:
510
- '*.*.*'
6-
# branches:
7-
# - main
11+
branches:
12+
- main
813
env:
914
nim-version: 'stable'
10-
nim-src: src/${{ github.event.repository.name }}.nim
15+
repo_alias: gccjit
1116
deploy-dir: .gh-pages
1217
jobs:
1318
docs:
@@ -18,22 +23,19 @@ jobs:
1823
with:
1924
nim-version: ${{ env.nim-version }}
2025
- run: nimble install -Y
21-
- run: nim doc --index:on --project --path:. --out:${{ env.deploy-dir }} ${{ env.nim-src }}
26+
- run: nim doc --index:on --project --path:. --out:${{ env.deploy-dir }} src/${{ env.repo_alias }}.nim
2227

2328
- name: "Rename to index.html"
24-
run: mv ${{ env.deploy-dir }}/${{ github.event.repository.name }}.html ${{ env.deploy-dir }}/index.html
29+
run: mv ${{ env.deploy-dir }}/${{ env.repo_alias }}.html ${{ env.deploy-dir }}/index.html
2530

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

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

3537
- name: Deploy documents
3638
uses: peaceiris/actions-gh-pages@v3
3739
with:
3840
github_token: ${{ secrets.GITHUB_TOKEN }}
39-
publish_dir: ${{ env.deploy-dir }}
41+
publish_dir: ${{ env.deploy-dir }}

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
- README.*
1313
- examples
1414
- .github/workflows
15+
env:
16+
mainfile: src/gccjit
1517
jobs:
1618
test:
1719
runs-on: ubuntu-latest
@@ -26,5 +28,5 @@ jobs:
2628
nim-version: ${{ matrix.nim-version }}
2729
repo-token: ${{ secrets.GITHUB_TOKEN }}
2830
- run: nimble install -Y
29-
- run: nim c -r src/${{ github.event.repository.name }}.nim
30-
- run: nimble test
31+
- run: nim c -r ${{ env.mainfile }}.nim
32+
- run: nimble test

0 commit comments

Comments
 (0)