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 .DEFAULT_GOAL := site
SITE = period3.xyz SITE = period3.xyz
deploy: HOST = pluto
git push HOST_DIR = $(HOST):~
ssh $(HOST) ./deploy-$(SITE)
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)