website/bin/deploykit-gmi.sh
Andrei Jiroh Halili c88c2e5519
chore(global): some CI script fix for Gemini deployments
Also added some scripts to Pipfile and minimal update to FAQ page.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
2023-10-01 08:33:49 +08:00

23 lines
694 B
Bash
Executable file

#!/usr/bin/env bash
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
mkdir "gmi/api"
git rev-parse HEAD > "gmi/api/commit"
tar -C gmi -cvz . -f gemini-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}"