Merge pull request 'custom deploy [ci skip]' (#7) from custom-deploy into main

Reviewed-on: #7
This commit is contained in:
stevensting 2025-02-07 17:29:18 +00:00
commit 54624241bd
3 changed files with 11 additions and 0 deletions

View File

@ -17,3 +17,7 @@ HUGO_GIT_URL=git@codeberg.org:eotl/example-repo.git
#COMPOSE_FILE="$COMPOSE_FILE: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

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

View File

@ -29,6 +29,11 @@ if [ ! -z "$HUGO_GIT_BRANCH" ]; then
git checkout origin/$HUGO_GIT_BRANCH
fi
if [ "$CUSTOM_DEPLOY_ENABLED" == "1" ]; then
echo "◆ Executing custom deploy script: $HUGO_WORKING_DIR/$CUSTOM_DEPLOY_SCRIPT"
bash $HUGO_WORKING_DIR/$CUSTOM_DEPLOY_SCRIPT
fi
echo "◆ Install or update Hugo Modules"
hugo mod get -u