54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
# 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
|
|
# Make sure the codeberg_token has "Repository and Organization Access" -> "package" -> "Read and Write"
|
|
# 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
|
|
event: [push, pull_request]
|
|
|
|
# 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: hugomods/hugo:exts
|
|
commands:
|
|
- hugo --minify
|
|
when:
|
|
event: [pull_request, push]
|
|
|
|
deploy-via-scp:
|
|
image: appleboy/drone-scp
|
|
settings:
|
|
host: h51.hostsharing.net
|
|
username: hsh08-ci.tmp
|
|
key:
|
|
from_secret: SSH_DEPLOY_KEY # private key (single-purpose)
|
|
#fingerprint:
|
|
# from_secret: SSH_HOST_FINGERPRINT # e.g. "SHA256:AbC...xyz"
|
|
port: 22
|
|
target: /home/pacs/hsh08/users/ci.tmp/doms/ci.tmp.app.hs.coop/htdocs-ssl/ # write-only dir
|
|
source:
|
|
- public/*
|
|
strip_components: 1
|
|
rm: true # clean target before copy
|
|
when:
|
|
event: push
|
|
branch: main
|