-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (30 loc) · 1.24 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
.PHONY: deploy
deploy: deploy-ui deploy-ws
ui/public/icon-512x512.png: ui/public/icon.svg
rsvg-convert --height 512 --output ui/public/icon-512x512.png ui/public/icon.svg
ui/public/icon-256x256.png: ui/public/icon.svg
rsvg-convert --height 256 --output ui/public/icon-256x256.png ui/public/icon.svg
ui/public/icon-192x192.png: ui/public/icon.svg
rsvg-convert --height 192 --output ui/public/icon-192x192.png ui/public/icon.svg
.PHONY: build-ui
build-ui: ui/public/icon-512x512.png ui/public/icon-256x256.png ui/public/icon-192x192.png
cd ui && npm ci && npm run build
.PHONY: deploy-ui
deploy-ui: build-ui
rsync --archive --delay-updates ui/dist/ horse:/data/teeko.cc/
curl -sfX POST "https://api.cloudflare.com/client/v4/zones/664e4bfb647853cad92f1bf7d0a20b35/purge_cache" \
-H "Authorization: Bearer $$(< ~/.cfpurgetoken)" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
ws/bundle.js: ws/index.ts common/src/model.ts
deno bundle ws/index.ts ws/bundle.js
.PHONY: deploy-ws
deploy-ws: ws/bundle.js
rsync --archive ws/bundle.js horse:/data/ws.teeko.cc/
ssh horse doas systemctl restart teeko-ws
.PHONY: ws
ws:
deno run --allow-net --allow-env ws/index.ts
.PHONY: ui
ui:
cd ui && npm ci && npm run build && npm start