43 lines
945 B
YAML
43 lines
945 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
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: 'latest'
|
|
|
|
- name: Ensure Output Directory Exists
|
|
run: |
|
|
mkdir -p /data/hugo/public
|
|
chmod -R 777 /data/hugo/public
|
|
|
|
- name: Debug Working Directory
|
|
run: |
|
|
pwd
|
|
ls -la
|
|
find . -name "hugo.toml"
|
|
hugo config
|
|
|
|
- name: Build Hugo Site
|
|
working-directory: /workspace/john/hugo-blog
|
|
run: |
|
|
hugo --minify -d /data/hugo/public --config hugo.toml
|
|
|
|
# Verify the build was successful
|
|
if [ ! -d /data/hugo/public ]; then
|
|
echo "Hugo build failed - public directory not created"
|
|
exit 1
|
|
fi
|