aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-04-30 18:30:38 +0200
committerRomain Gonçalves <me@rgoncalves.se>2022-04-30 18:30:38 +0200
commit7de7a8ae6187e5efea3895c593fe554a84178289 (patch)
tree544d59aa8d2d526b00d36296f434e75422e746d4
parent604a9727e05ba465cbbc4118c1a909f4e9528348 (diff)
downloadrgoncalves.se-7de7a8ae6187e5efea3895c593fe554a84178289.tar.gz
Makefile: add preview target
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e1b9bab..76261af 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@
REMOTE := root@dc0
REMOTE_DIR := /var/www/htdocs/rgoncalves.se
+OUTPUT_DIR := ./out
+TEMPORARY_DIR := ./tmp
.PHONY: all \
site \
@@ -11,9 +13,12 @@ site: clean
./bin/ssg
./bin/rssg
+preview: site
+ python3 -m http.server --directory $(OUTPUT_DIR) --bind 127.0.0.1
+
clean:
- - rm -r out tmp
+ - rm -r $(OUTPUT_DIR) $(TEMPORARY_DIR)
deploy: site
- rsync -e ssh -avz --delete ./out/ $(REMOTE):$(REMOTE_DIR)
+ rsync -e ssh -avz --delete $(OUTPUT_DIR)/ $(REMOTE):$(REMOTE_DIR)
ssh $(REMOTE) chown -R www:www $(REMOTE_DIR)
remember that computers suck.