2023-07-31 15:51:56 +02:00
|
|
|
# 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
|
2023-08-08 09:27:53 +02:00
|
|
|
environment:
|
|
|
|
- HUGO_VERSION=0.117.0
|
2023-07-31 15:51:56 +02:00
|
|
|
when:
|
2023-08-08 09:27:53 +02:00
|
|
|
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
|
2023-07-31 15:51:56 +02:00
|
|
|
|
2023-08-01 09:10:15 +02:00
|
|
|
|
|
|
|
netlify-deploy:
|
|
|
|
image: node:alpine
|
2023-07-31 15:51:56 +02:00
|
|
|
when:
|
|
|
|
event: push
|
2023-08-01 09:10:15 +02:00
|
|
|
secrets:
|
|
|
|
- NETLIFY_AUTH_TOKEN
|
|
|
|
- NETLIFY_SITE_ID
|
|
|
|
commands:
|
|
|
|
- npm install netlify-cli -g
|
2023-08-08 09:27:53 +02:00
|
|
|
- netlify deploy --prod --dir ./hugo_public
|