website/.woodpecker/deploy.yml

71 lines
2.1 KiB
YAML
Raw Normal View History

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
commands:
- wget https://github.com/gohugoio/hugo/releases/download/v0.116.0/hugo_extended_0.116.0_linux-amd64.deb && apt install ./hugo_extended_0.116.0_linux-amd64.deb && rm -f hugo_extended_0.116.0_linux-amd64.deb
- hugo --minify --destination ./hugo_public
when:
event: [ pull_request, push ]
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
- netlify deploy --prod --dir ./hugo_public
# publish:
# image: bitnami/git
# # Must be set in Woodpecker configuration
# secrets:
# - codeberg_token
# environment:
# DEST_REPONAME: dest_repo
# commands:
# # Git configuration
# - git config --global user.email noreply@example.com
# - git config --global user.name "Woodpecker CI"
# - git clone https://$CODEBERG_TOKEN@codeberg.org/lila-network/pages.git $DEST_REPONAME
# # Copy build step output to repository folder
# - cp -ar ./hugo_public/. $DEST_REPONAME/
# # Needed for custom domains
# - cp .domains $DEST_REPONAME || true # Ignore if it doesn't exist
# # Commit and push all static files with pipeline started timestamp
# - cd $DEST_REPONAME
# - git add .
# - git commit -m "Woodpecker CI ${CI_BUILD_CREATED}"
# - git push
# when:
# event: push