# hugo.yml # # Takes a repository with Hugo source, generates the static site and # pushes the result to Codeberg pages # # Needs a codeberg access token (codeberg_token) as a secret in Woodpecker config # Also uses another secret (mail) with email address for git config # # .domains file in the repository is copied to the output branch so custom domains work # # The HUGO_OUTPUT variable must be set to the build output folder configured in Hugo # # Exclude page pipeline to be run on "pages" branch when: branch: exclude: pages # Recursive cloning is used to fully clone the themes given as Git submodules clone: git: image: woodpeckerci/plugin-git settings: recursive: true steps: # Build hugo static files build: image: golang:1.20-bookworm environment: - HUGO_VERSION=0.117.0 when: event: push commands: - wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb - hugo --minify --destination ./public netlify-deploy: image: node:alpine when: event: push secrets: - NETLIFY_AUTH_TOKEN - NETLIFY_SITE_ID commands: - npm install netlify-cli -g - netlify deploy --prod --dir ./hugo_public