-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
84 lines (76 loc) · 1.82 KB
/
Taskfile.yaml
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
77
78
79
80
81
82
83
84
---
version: 3
vars:
DOCKER_RUN: >-
docker run
--rm
--interactive
--tty
--user=$(id -u):$(id -g)
--mount type=bind,source=$(pwd),target=/src
--workdir="/src"
DOCKER_IMAGE_YAMLLINT: cytopia/yamllint:latest
DOCKER_IMAGE_HUGO: klakegg/hugo:0.101.0-ext
TAILWIND: >-
npx tailwindcss
--input="$(pwd)/resources/main.css"
--output="$(pwd)/static/css/main.css"
--output="$(pwd)/static/css/main.css"
tasks:
default:
silent: true
cmds:
- cmd: task --list --sort=none
lint:
desc: Lint all yaml files
interactive: true
silent: true
cmds:
- "{{.DOCKER_RUN}} {{.DOCKER_IMAGE_YAMLLINT}} {{.CLI_ARGS}} ."
server:
desc: Mounts current `pwd` and runs `hugo server` in a container
interactive: true
silent: true
ignore_error: true
cmds:
- >-
{{.DOCKER_RUN}}
--publish="1313:1313"
{{.DOCKER_IMAGE_HUGO}}
server
--appendPort
--port=1313
--noHTTPCache
--baseURL=http://localhost
--buildFuture
--buildDrafts
shell:
desc: Mounts current `pwd` and runs `sh` in a `hugo` container
silent: true
cmds:
- >-
{{.DOCKER_RUN}}
--entrypoint="sh"
{{.DOCKER_IMAGE_HUGO}}
build:
desc: Mounts current `pwd` and runs `hugo build` in a `hugo` container
silent: true
cmds:
- >-
{{.DOCKER_RUN}}
{{.DOCKER_IMAGE_HUGO}}
theme:
desc: Runs `npx tailwind --watch`, i.e. re-build theme assets for dev
silent: true
ignore_error: true
cmds:
- cmd: rm ./static/css/main.css
ignore_error: true
- "{{.TAILWIND}} --watch"
assets:
desc: Runs `npx tailwind --minify`, i.e. generate new build of theme assets for prod
silent: true
cmds:
- cmd: rm ./static/css/main.css
ignore_error: true
- "{{.TAILWIND}} --minify"