-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.woodpecker.yml
More file actions
43 lines (40 loc) · 1.14 KB
/
.woodpecker.yml
File metadata and controls
43 lines (40 loc) · 1.14 KB
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
# 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 zola static files
build:
image: alpine
commands:
- apk add zola
- zola build
when:
event: [ pull_request, push ]
publish:
image: bitnami/git
# Must be set in Woodpecker configuration
secrets: [ mail, codeberg_token ]
commands:
# Git configuration
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
- git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
# Enter repository folder
- cd $CI_REPO_NAME
# Remove old files from repository folder
- git rm -r "*"
# Copy build step output to repository folder
- cp -ar ../public/. .
# Commit and push all static files with source commit SHA
- git add --all
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]"
- git push
when:
event: push