diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 389d24a..535bb4b 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -7,33 +7,29 @@ jobs: container: image: 192.168.254.5:5000/hugo:v0.163.3 steps: - - name: Checkout repository (shell) + - name: Create Hugo site 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 + hugo new site /tmp/hugo-site + + - name: Clone repository to content directory + run: | + set -e + REPO_URL="http://192.168.8.126:3000/blogs/outcomes.git" + if [ -n "${CI_REPOSITORY_URL:-}" ]; then + REPO_URL="${CI_REPOSITORY_URL}" fi + echo "Cloning $REPO_URL to content directory" + git clone --depth=1 "$REPO_URL" /tmp/hugo-site/content - name: Build site with Hugo + working-directory: /tmp/hugo-site run: | set -e hugo --minify - name: Show generated files + working-directory: /tmp/hugo-site run: | echo "Public directory contents:" ls -la public || true \ No newline at end of file