Blog/docker/entrypoint.sh
Vezpi d51b89690b
All checks were successful
Blog Deployment / check-rebuild (push) Successful in 4s
Blog Deployment / build (push) Successful in 8s
Blog Deployment / deploy-staging (push) Successful in 8s
Blog Deployment / test-staging (push) Successful in 2s
Blog Deployment / merge (push) Successful in 6s
Blog Deployment / deploy-production (push) Successful in 9s
Blog Deployment / test-production (push) Successful in 2s
Blog Deployment / clean (push) Has been skipped
fix: remove URL
2025-06-04 21:37:43 +00:00

26 lines
739 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 == "preview" ]; then
DRAFTS="--buildDrafts"
fi
# Clone repo
echo "- Cloning $REPO_URL (branch: $BRANCH)..."
git clone --depth 1 --recurse-submodules --branch "$BRANCH" "$REPO_URL" "$CLONE_DIR"
# Generate static files with hugo
echo "- Building site with Hugo v$HUGO_VERSION in $HUGO_DEST..."
hugo --source "$CLONE_DIR" --destination "$HUGO_DEST" $DRAFTS --logLevel info --cleanDestinationDir --gc --panicOnWarning --printI18nWarnings
# Start nginx
echo "- Starting Nginx..."
exec nginx -g 'daemon off;'