-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
76 lines (66 loc) · 2.15 KB
/
Taskfile.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
72
73
74
75
76
version: '3'
vars:
WORKING_DIRECTORY: '{{.github.workspace | default .PWD}}'
BUNDLE_PATH: '.vendor'
ID_UID:
sh: id -u
ID_GID:
sh: id -g
TARGET: '{{.TARGET | default "_site"}}'
BUILD_WATCH_FILES: find . -name '*' -not -path "./.git/*" -not -path "./.git" -not -path "./.jekyll-cache/*" -not -path "./.jekyll-cache" -not -path "./{{.TARGET}}" -not -path "./{{.TARGET}}/*"
tasks:
default:
desc: List the available tasks
cmds:
- task -l
bib:update:
desc: Update the ttl files for the individual bibliography resources
cmds:
- |
cd _data
rm -r bib || true
./extract.py --file bib.ttl --base https://natanael.arndt.xyz/ --selection selection.sparql
cd ..
rm -r ttl/bib || true
cp -r _data/bib ttl/
build:
desc: Build the page from source
cmds:
- task: build:docker
vars:
LANGUAGE: de
TARGET: '{{.TARGET}}'
build:docker:
desc: Build the page from source using docker
vars:
JEKYLL_UID: '{{.JEKYLL_UID | default .ID_UID}}'
JEKYLL_GID: '{{.JEKYLL_GID | default .ID_GID}}'
JEKYLL_USER_ARG:
sh: '[ "$(docker info --format "{{`{{if .Host.Security.Rootless}}true{{end}}`}}")" = "true" ] || echo -u "{{.JEKYLL_UID}}:{{.JEKYLL_GID}}"'
JEKYLL_IMAGE: ghcr.io/aksw/jekyll-rdf:4.0.4
cmds:
- |
docker run --rm \
--workdir /github/workspace \
-v {{.WORKING_DIRECTORY}}:/github/workspace \
-e TZ=Europe/Berlin {{.JEKYLL_USER_ARG}} -e BUNDLE_PATH={{.BUNDLE_PATH}} \
{{.JEKYLL_IMAGE}} jekyll build -d {{.TARGET}}
watch:
desc: Serve the page and rebuild it on changes
deps:
- task: serve
- task: build:watch
cmds:
- echo "Terminate"
build:watch:
desc: Watch for changes in the directory and rebuild the page, should be combined with task serve in a second terminal
cmds:
- '{{.BUILD_WATCH_FILES}} | entr task build'
serve:
desc: Serve the locally built site
cmds:
- python -m http.server --directory {{.TARGET}}
clean:
desc: Clean up temporary direcotries
cmds:
- rm -r .vendor .jekyll-cache .bundle