2023-09-26 09:16:39 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-07-15 16:49:46 +00:00
|
|
|
set -xe
|
|
|
|
|
|
|
|
SOURCEHUT_USERNAME=${SOURCEHUT_PAGES_SUBDOMAIN:-"ajhalili2006"}
|
|
|
|
GEMINI_CUSTOM_DOMAIN=${GEMINI_CUSTOM_DOMAIN:-"gemini.andreijiroh.eu.org"}
|
|
|
|
|
|
|
|
if [[ $SOURCEHUT_PAGES_TOKEN == "" ]]; then
|
|
|
|
echo "missing SOURCEHUT_PAGES_TOKEN variable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-07-15 17:40:48 +00:00
|
|
|
mkdir "gmi/api"
|
|
|
|
git rev-parse HEAD > "gmi/api/commit"
|
2023-07-15 16:49:46 +00:00
|
|
|
tar -C gmi -cvz . -f site.tar.gz
|
|
|
|
|
|
|
|
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
|
|
|
|
-Fcontent=@site.tar.gz \
|
|
|
|
-Fprotocol=GEMINI \
|
|
|
|
"https://pages.sr.ht/publish/${SOURCEHUT_USERNAME}.srht.site"
|
|
|
|
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
|
|
|
|
-Fcontent=@site.tar.gz \
|
|
|
|
-Fprotocol=GEMINI \
|
|
|
|
"https://pages.sr.ht/publish/${GEMINI_CUSTOM_DOMAIN}"
|