mirror of
https://mau.dev/andreijiroh-dev/website.git
synced 2024-11-24 17:33:48 +00:00
df1889bd41
Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.eu.org>
27 lines
1.1 KiB
Bash
Executable file
27 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
PRIVATE_SSH_KEY=${PRIVATE_SSH_KEY:-"/run/secrets/passwordless"}
|
|
SOURCEHUT_USERNAME=${SOURCEHUT_PAGES_SUBDOMAIN:-"ajhalili2006"}
|
|
SOURCEHUT_PAGES_TOKEN=${SOURCEHUT_PAGES_TOKEN}
|
|
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=@gemini-site.tar.gz \
|
|
-Fprotocol=GEMINI \
|
|
"https://pages.sr.ht/publish/${SOURCEHUT_USERNAME}.srht.site"
|
|
curl --oauth2-bearer "$SOURCEHUT_PAGES_TOKEN" \
|
|
-Fcontent=@gemini-site.tar.gz \
|
|
-Fprotocol=GEMINI \
|
|
"https://pages.sr.ht/publish/${GEMINI_CUSTOM_DOMAIN}"
|
|
|
|
rsync -rP -e "ssh -i ${PRIVATE_SSH_KEY} -o StrictHostKeyChecking=no" gmi/ ajhalili2006@p.projectsegfau.lt:/home/ajhalili2006/public_gemini
|
|
rsync -rP -e "ssh -i ${PRIVATE_SSH_KEY} -o StrictHostKeyChecking=no" gmi/ ajhalili2006@s1.dimension.sh:/home/ajhalili2006/public_gemini
|