Skip to content

Commit 20aaeaf

Browse files
[CI] Run docs check in separate workflow with path restriction (#657)
The docs workflow only needs to run when there are changes to the docs or doc processing. Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
1 parent 1c672c2 commit 20aaeaf

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,3 @@ jobs:
6060

6161
- name: Check formatting
6262
run: crystal tool format --check src spec
63-
64-
docs:
65-
runs-on: ubuntu-24.04
66-
steps:
67-
- name: Download source
68-
uses: actions/checkout@v4
69-
- name: Build manpages
70-
uses: Analog-inc/[email protected]
71-
with:
72-
shellcommand: "make -B manpages SOURCE_DATE_EPOCH=\"$(date +%s --utc --date \"$(grep -m1 -o -E 'Date: .*' man/shard.yml.5 | cut -d' ' -f2)\")\""
73-
- name: Ensure no changes
74-
run: git diff --exit-code

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
paths:
6+
- docs/*.adoc
7+
- .github/workflows/docs.yml
8+
- VERSION
9+
- docs.mk
10+
pull_request:
11+
paths:
12+
- docs/*.adoc
13+
- .github/workflows/docs.yml
14+
- VERSION
15+
- docs.mk
16+
17+
permissions: {}
18+
19+
jobs:
20+
docs:
21+
runs-on: ubuntu-24.04
22+
steps:
23+
- name: Download source
24+
uses: actions/checkout@v4
25+
- name: Build manpages
26+
uses: Analog-inc/[email protected]
27+
with:
28+
shellcommand: "make -B manpages SOURCE_DATE_EPOCH=\"$(date +%s --utc --date \"$(grep -m1 -o -E 'Date: .*' man/shard.yml.5 | cut -d' ' -f2)\")\""
29+
- name: Ensure no changes
30+
run: git diff --exit-code || echo '`make manpages` produced changes. Please rebuild the docs.'

0 commit comments

Comments
 (0)