37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: Build and deploy Hugo site
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: hugo:docker://192.168.8.254.5:5000/hugo:v0.163.3
|
|
steps:
|
|
- name: Checkout repository (shell)
|
|
run: |
|
|
set -e
|
|
# If repository already checked out on the runner, use it
|
|
if [ -d .git ]; then
|
|
echo "Repository already present"
|
|
git status --porcelain || true
|
|
else
|
|
# Use provided repository URL (fallback to common CI env var if present)
|
|
REPO_URL="http://192.168.8.126:3000/blogs/outcomes.git"
|
|
if [ -n "${CI_REPOSITORY_URL:-}" ]; then
|
|
REPO_URL="${CI_REPOSITORY_URL}"
|
|
fi
|
|
if [ -n "$REPO_URL" ]; then
|
|
echo "Cloning $REPO_URL"
|
|
git clone --depth=1 "$REPO_URL" .
|
|
else
|
|
echo "No repository URL found in environment; proceeding with current directory"
|
|
fi
|
|
fi
|
|
|
|
- name: Build site with Hugo
|
|
run: |
|
|
set -e
|
|
hugo --minify
|
|
|
|
- name: Show generated files
|
|
run: |
|
|
echo "Public directory contents:"
|
|
ls -la public || true |