-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (56 loc) · 1.37 KB
/
Makefile
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
IMAGE_NAME = webserver
TAG = 0.1
PORT = ${WEBSERVER_PORT}
SYSTEM = x86_64-linux
run:
nix run github:Mic92/nix-fast-build -- --flake '.#packages.$(SYSTEM).default'
nix run
docker/build:
nix build .#container
docker: build/docker
docker load < result
docker run \
--rm \
--env-file ./.env \
-p 127.0.0.1:$(PORT):$(PORT) \
-t $(IMAGE_NAME):$(TAG)
live/templ:
templ generate \
--watch \
--proxy="http://localhost:3001" \
--open-browser=false \
-v \
--path=./services/webserver/
live/server:
air \
--build.cmd "go build -o tmp/bin/main personal-website/services/webserver" \
--build.bin "tmp/bin/main" \
--build.delay "100" \
--build.include_ext "go" \
--build.stop_on_error "false" \
--misc.clean_on_exit true \
--proxy.enabled true \
--proxy.proxy_port 3001 \
--proxy.app_port $(PORT)
live/tailwind:
rsync -a ./services/webserver/public/* ./public --exclude='*.css'
rm -f ./public/main.css
tailwindcss \
-c ./services/webserver/tailwind.config.js \
-i ./services/webserver/public/main.css \
-o ./public/main.css \
-m \
-w
live/sync_assets:
air \
--build.cmd "templ generate --notify-proxy" \
--build.bin "true" \
--build.delay "100" \
--build.exclude_dir "" \
--build.include_dir "public" \
--build.include_ext "js,css"
live:
make live/templ & \
make live/server & \
make live/tailwind & \
(sleep 0.1 && make live/sync_assets)