try CI
This commit is contained in:
parent
6efb677e0b
commit
2895de9e82
3 changed files with 64 additions and 1 deletions
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"yaml.schemas": {
|
||||
"https://raw.githubusercontent.com/woodpecker-ci/woodpecker/master/pipeline/schema/schema.json": "file:///home/laura/git/lila-network-website/static/.woodpecker/deploy.yml"
|
||||
}
|
||||
}
|
58
.woodpecker/deploy.yml
Normal file
58
.woodpecker/deploy.yml
Normal file
|
@ -0,0 +1,58 @@
|
|||
# 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 ]
|
||||
|
||||
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 -b pages 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
|
|
@ -54,4 +54,4 @@ author:
|
|||
module:
|
||||
hugoVersion:
|
||||
extended: false
|
||||
min: 0.86.1
|
||||
min: "v0.86.1"
|
||||
|
|
Loading…
Reference in a new issue