More script updates and site content changes

Also in this commit, I added my Keybase proof btw.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-07-15 16:49:46 +00:00
parent 8b77e1e70f
commit 3e9b4b9bf3
7 changed files with 148 additions and 13 deletions

21
bin/deploykit-gmi.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/env
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
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}"

View file

@ -48,6 +48,13 @@ else
${DEPLOY_COMMAND:-"$_command_prefix"}
fi
if [[ $_branch_name_git == "main" ]]; then
tar -C public -cvz . -f site-build.tar.gz
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
-Fcontent=@site-build.tar.gz \
"https://pages.sr.ht/publish/ajhalili2006.srht.site"
fi
if [[ $DEBUG != "" ]]; then
set +x
fi

View file

@ -1,11 +0,0 @@
#!/bin/env bash
if [[ $SOURCEHUT_PAGES_TOKEN == "" ]]; then
echo "missing SOURCEHUT_PAGES_TOKEN variable"
exit 1
fi
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
-Fcontent=@site.tar.gz \
-Fprotocol=GEMINI \
https://pages.sr.ht/publish/username.srht.site