Add deploy script

This commit is contained in:
Timothée Floure 2021-01-04 07:58:18 +01:00
parent 26a57aeff1
commit 9c2bd43c8f
Signed by: tfloure
GPG Key ID: 4502C902C00A1E12
3 changed files with 11 additions and 7 deletions

View File

@ -8,23 +8,18 @@ BASE_TITLE = Recycled Cloud
PAGES = index.html services.html manifesto.html contact.html
BLOBS = assets/
# Default target.
all: $(PAGES)
clean:
rm -rf $(PAGES)
# If you built it, flaunt it!
deploy: $(PAGES) $(BLOBS)
./deploy.sh $^
.part.html:
./page-template.sh $+ > $@
# Setup some common dependencies so updating targets work.
$(PAGES): page-template.sh assets
# Modify variables ?
index.html: TITLE = "$(BASE_TITLE) | Home"
services.html: TITLE = "$(BASE_TITLE) | Services"
manifesto.html: TITLE = "$(BASE_TITLE) | Manifesto"

View File

@ -2,5 +2,5 @@
Static website generated with [Nyll](https://git.sr.ht/~sparrowhawk/nyll). Depends on:
* `make`
* `sh`
* `make`
* `sh`

9
deploy.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
DESTINATION=root@static.recycled.cloud:/var/www/
WEBSITE=static.staging.recycled.cloud
sftp -b - "$DESTINATION" <<- EOF
-rm $WEBSITE/*
$(for f in "$@"; do echo "put -R $f $WEBSITE/"; done)
EOF