Blog/docker/entrypoint.sh
Vezpi c5546106a6
Some checks failed
Blog Deployment / check-rebuild (push) Successful in 4s
Blog Deployment / build (push) Has been skipped
Blog Deployment / deploy-staging (push) Successful in 9s
Blog Deployment / test-staging (push) Failing after 3s
Blog Deployment / merge (push) Has been skipped
Blog Deployment / deploy-production (push) Has been skipped
Blog Deployment / test-production (push) Has been skipped
Blog Deployment / clean (push) Has been skipped
fix: add condition on version for cleaning
2025-06-04 21:29:28 +00:00

23 lines
696 B
Bash

#!/bin/sh
set -e
# Configuration
REPO_URL="${REPO_URL:-https://git.vezpi.me/Vezpi/blog.git}"
URL="${URL:-blog.vezpi.com}"
BRANCH="${BRANCH:-preview}"
CLONE_DIR="${CLONE_DIR:-/blog}"
DRAFTS=""
# Add drafts for preview
if [ $BRANCH -eq "preview" ]; then
DRAFTS="--buildDrafts"
fi
echo "- Cloning $REPO_URL (branch: $BRANCH)..."
git clone --depth 1 --recurse-submodules --branch "$BRANCH" "$REPO_URL" "$CLONE_DIR"
echo "- Building site with Hugo v$HUGO_VERSION in $HUGO_DEST..."
hugo --source "$CLONE_DIR" --destination "$HUGO_DEST" --baseURL "$URL" $DRAFTS --logLevel info --cleanDestinationDir --gc --panicOnWarning --printI18nWarnings
echo "- Starting Nginx..."
exec nginx -g 'daemon off;'