-
Notifications
You must be signed in to change notification settings - Fork 0
/
.woodpecker.yml
61 lines (51 loc) · 1.57 KB
/
.woodpecker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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: floryn90/hugo
commands:
- hugo --minify -b "https://cb-blog.ummit.dev"
when:
event: [ pull_request, push ]
branch: [ master ]
publish:
image: bitnami/git
# Must be set in Woodpecker configuration
secrets: [ mail, codeberg_token ]
environment:
- HUGO_OUTPUT=public
commands:
# Git configuration
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
- cd ..
- git clone -b pages https://[email protected]/UmmIt/pages.git pages
- cp -ar Blog/$HUGO_OUTPUT/. pages/
# Commit and push all static files with pipeline started timestamp
- cd pages
- git add .
- git commit -m "[Woodpecker CI] Commit SHA ${CI_COMMIT_SHA}"
- git push origin pages
when:
event: push