37 lines
838 B
YAML
37 lines
838 B
YAML
name: Build Hugo Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Hugo
|
|
run: |
|
|
apt update
|
|
apt install -y hugo
|
|
|
|
- name: Build Hugo Site
|
|
run: |
|
|
# Print working directory for debugging
|
|
pwd
|
|
ls -la
|
|
|
|
# Navigate to Hugo site directory if it's in a subdirectory
|
|
cd /data/git/repositories/john/hugo
|
|
|
|
# Build directly to the mounted public directory
|
|
hugo --minify -d /data/hugo/public
|
|
|
|
# Verify the build was successful
|
|
if [ ! -d /data/hugo/public ]; then
|
|
echo "Hugo build failed - public directory not created"
|
|
exit 1
|
|
fi |