-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (67 loc) · 2.16 KB
/
template.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Template
on:
push:
branches-ignore:
- main
jobs:
template:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check if RDF files modified
id: rdfModified
uses: dorny/paths-filter@v3
with:
base: ${{ github.ref }}
list-files: csv
filters: |
modified:
- '**.ttl'
- '**.jsonld'
- '**.trig'
- '**.nt'
- '**.nq'
- '**.rdf'
- '**.trix'
- name: RDF syntax check
if: steps.rdfModified.outputs.modified == 'true'
uses: AtomGraph/[email protected]
- name: Check if config modified
id: configModified
uses: dorny/paths-filter@v3
with:
base: ${{ github.ref }}
list-files: csv
filters: |
modified:
- 'config/**'
- name: Template
if: steps.rdfModified.outputs.modified == 'true' || steps.configModified.outputs.modified == 'true'
run: |
docker run --rm \
--pull=always \
-v /$(pwd)/config:/config \
-v /$(pwd)/shapes:/shapes \
-v /$(pwd)/doc/gen/:/doc/gen ghcr.io/skemu/rdf-template:latest
- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Commit and push
if: steps.rdfModified.outputs.modified == 'true' || steps.configModified.outputs.modified == 'true'
run: |
git status
git add doc/gen/
git status
git diff --staged --quiet || git commit -F- <<EOF
Apply templates
The following RDF files were modified:
${{ steps.rdfModified.outputs.modified_files }}
The following config files were modified:
${{ steps.configModified.outputs.modified_files }}
EOF
git push
- name: No templateable changes
if: steps.rdfModified.outputs.modified == 'false' && steps.configModified.outputs.modified == 'false'
run: echo "No changes to template"