improve deploy script

This commit is contained in:
ktyl 2022-04-08 02:04:03 +01:00
parent 33337cf2ed
commit fb75a9b4de
3 changed files with 38 additions and 5 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# build artifact
period3.xyz

15
deploy.sh Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
site=period3.xyz
gemini=/home/gemini/gemini
dest="$gemini/content"
sudo rm -r $dest/*
sudo mv $site/* $dest
rm -r $site
printf "\n\tdone!\n\n"

View File

@ -1,6 +1,22 @@
HOST = pluto
SITE = period3.xyz
.DEFAULT_GOAL := site
deploy:
git push
ssh $(HOST) ./deploy-$(SITE)
SITE = period3.xyz
HOST = pluto
HOST_DIR = $(HOST):~
CONTENT = content/
DEPLOY = deploy.sh
site: $(SITE)
$(SITE): $(CONTENT)
[ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE)
deploy: site
rsync -P $(DEPLOY) $(HOST_DIR)
rsync -rP $(SITE) $(HOST_DIR)
ssh $(HOST) "bash -s" < $(DEPLOY)
clean:
rm -r $(SITE)