wip: custom deploy [ci skip]

See #6
This commit is contained in:
decentral1se 2024-04-02 22:57:02 +02:00
parent 5cdf3b3965
commit 6dfff1c535
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
4 changed files with 13 additions and 1 deletions

View File

@ -16,3 +16,7 @@ HUGO_GIT_URL=git@codeberg.org:offline/future.git
#COMPOSE_FILE="compose.yml:compose.private.yml"
#PRIVATE_ENABLED=1
#SECRET_DEPLOY_KEY_VERSION=v1
# Custom deployment script
#CUSTOM_DEPLOY_ENABLED=1
#CUSTOM_DEPLOY_SCRIPT=path/customscript.sh

View File

@ -3,4 +3,4 @@ export BADGER_ENTRYPOINT_VERSION=v1
export DEFAULT_CONF_VERSION=v1
export SSH_CONF_VERSION=v1
export SSH_DEPLOY_KEY_VERSION=v1
export WEBHOOKD_SCRIPT_VERSION=v1
export WEBHOOKD_SCRIPT_VERSION=v2

View File

@ -30,6 +30,8 @@ services:
badger:
image: codeberg.org/eotl/site-badger:0.1.0
environment:
- CUSTOM_DEPLOY_ENABLED
- CUSTOM_DEPLOY_SCRIPT
- HUGO_GIT_URL
- HUGO_PUBLIC_DIR=/usr/share/nginx/website
- HUGO_WORKING_DIR=/root/website

View File

@ -23,6 +23,12 @@ echo "◆ Pull latest version from .git repository"
git fetch --all
git reset --hard origin/main
if [ "$CUSTOM_DEPLOY_ENABLED" == "1" ]; then
echo "◆ Executing custom deploy script: $HUGO_WORKING_DIR/$CUSTOM_DEPLOY_SCRIPT"
bash $HUGO_WORKING_DIR/$CUSTOM_DEPLOY_SCRIPT
exit 0
fi
echo "◆ Install or update Hugo Modules"
hugo mod get -u