wip: custom deploy

See #6
This commit is contained in:
decentral1se 2024-04-02 22:57:02 +02:00
parent 5cdf3b3965
commit 3799fb5b3a
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
3 changed files with 12 additions and 0 deletions

View File

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

View File

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

View File

@ -23,6 +23,12 @@ echo "◆ Pull latest version from .git repository"
git fetch --all git fetch --all
git reset --hard origin/main 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" echo "◆ Install or update Hugo Modules"
hugo mod get -u hugo mod get -u