Sync from GitHub via hub-sync
Browse files- .woodpecker.yaml +38 -10
.woodpecker.yaml
CHANGED
|
@@ -3,32 +3,58 @@ when:
|
|
| 3 |
branch:
|
| 4 |
exclude: pages
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
clone:
|
| 8 |
git:
|
| 9 |
image: woodpeckerci/plugin-git
|
| 10 |
settings:
|
| 11 |
-
recursive:
|
| 12 |
|
| 13 |
steps:
|
| 14 |
# Ephemerally restructure for Zola
|
| 15 |
prepare:
|
| 16 |
image: alpine:edge
|
| 17 |
commands:
|
| 18 |
-
- apk add rsync
|
| 19 |
-
- mkdir -p content static
|
| 20 |
-
-
|
|
|
|
|
|
|
| 21 |
- rsync -av assets/ static/
|
|
|
|
|
|
|
| 22 |
- |
|
| 23 |
-
cat
|
| 24 |
title = "私路 - 隱私之路"
|
| 25 |
description = "正體中文的數位隱私教育素材"
|
| 26 |
default_language = "zh_TW"
|
| 27 |
-
theme = "
|
|
|
|
|
|
|
| 28 |
output_dir = "public"
|
| 29 |
-
|
| 30 |
[markdown]
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
EOF
|
| 33 |
when:
|
| 34 |
event: [push, pull_request]
|
|
@@ -37,7 +63,8 @@ steps:
|
|
| 37 |
build:
|
| 38 |
image: alpine:edge
|
| 39 |
commands:
|
| 40 |
-
- apk add zola
|
|
|
|
| 41 |
- zola build
|
| 42 |
when:
|
| 43 |
event: [push, pull_request]
|
|
@@ -50,6 +77,7 @@ steps:
|
|
| 50 |
CBTOKEN:
|
| 51 |
from_secret: "codeberg_token"
|
| 52 |
commands:
|
|
|
|
| 53 |
# Configure Git
|
| 54 |
- git config --global user.email "$${CBMAIL}"
|
| 55 |
- git config --global user.name "Woodpecker CI"
|
|
|
|
| 3 |
branch:
|
| 4 |
exclude: pages
|
| 5 |
|
| 6 |
+
# Shared volume + working directory for all steps in this workflow
|
| 7 |
+
workspace:
|
| 8 |
+
base: /woodpecker
|
| 9 |
+
path: src/privacy_guides_tw
|
| 10 |
+
|
| 11 |
clone:
|
| 12 |
git:
|
| 13 |
image: woodpeckerci/plugin-git
|
| 14 |
settings:
|
| 15 |
+
recursive: false
|
| 16 |
|
| 17 |
steps:
|
| 18 |
# Ephemerally restructure for Zola
|
| 19 |
prepare:
|
| 20 |
image: alpine:edge
|
| 21 |
commands:
|
| 22 |
+
- apk add --no-cache git rsync zola
|
| 23 |
+
- mkdir -p content static themes
|
| 24 |
+
- cp README.md content/_index.md
|
| 25 |
+
- rsync -av --exclude='assets/' *.md content/
|
| 26 |
+
- for f in content/*.md; do title=$(head -n 1 "$f" | sed 's/^# //'); if [ "$f" = "content/_index.md" ]; then printf '+++\ntitle = "私路 - 隱私之路"\n+++\n\n' > "$f.tmp" && tail -n +2 "$f" >> "$f.tmp" && mv "$f.tmp" "$f"; else printf '+++\ntitle = "%s"\ndate = "1989-06-04"\n+++\n\n' "$title" > "$f.tmp" && tail -n +2 "$f" >> "$f.tmp" && mv "$f.tmp" "$f"; fi; done
|
| 27 |
- rsync -av assets/ static/
|
| 28 |
+
- git clone --depth 1 https://github.com/hulufei/solar-theme-zola.git themes/solar-theme-zola
|
| 29 |
+
- sed -i 's/config\.markdown\.highlight_theme/config.markdown.highlighting.theme/g' themes/solar-theme-zola/templates/index.html
|
| 30 |
- |
|
| 31 |
+
cat > config.toml <<EOF
|
| 32 |
title = "私路 - 隱私之路"
|
| 33 |
description = "正體中文的數位隱私教育素材"
|
| 34 |
default_language = "zh_TW"
|
| 35 |
+
theme = "solar-theme-zola"
|
| 36 |
+
|
| 37 |
+
base_url = "https://${CI_REPO_OWNER}.codeberg.page/${CI_REPO_NAME}"
|
| 38 |
output_dir = "public"
|
| 39 |
+
|
| 40 |
[markdown]
|
| 41 |
+
render_emoji = false
|
| 42 |
+
external_links_target_blank = false
|
| 43 |
+
external_links_no_follow = false
|
| 44 |
+
external_links_no_referrer = false
|
| 45 |
+
external_links_external = false
|
| 46 |
+
smart_punctuation = false
|
| 47 |
+
definition_list = false
|
| 48 |
+
bottom_footnotes = false
|
| 49 |
+
lazy_async_image = false
|
| 50 |
+
insert_anchor_links = "none"
|
| 51 |
+
github_alerts = false
|
| 52 |
+
|
| 53 |
+
[markdown.highlighting]
|
| 54 |
+
theme = "solarized-dark"
|
| 55 |
+
|
| 56 |
+
[extra]
|
| 57 |
+
highlight_theme = "solarized-dark"
|
| 58 |
EOF
|
| 59 |
when:
|
| 60 |
event: [push, pull_request]
|
|
|
|
| 63 |
build:
|
| 64 |
image: alpine:edge
|
| 65 |
commands:
|
| 66 |
+
- apk add --no-cache zola
|
| 67 |
+
- test -f config.toml && test -d themes/solar-theme-zola || { echo "workspace NOT shared with prepare"; ls -la; exit 1; }
|
| 68 |
- zola build
|
| 69 |
when:
|
| 70 |
event: [push, pull_request]
|
|
|
|
| 77 |
CBTOKEN:
|
| 78 |
from_secret: "codeberg_token"
|
| 79 |
commands:
|
| 80 |
+
|
| 81 |
# Configure Git
|
| 82 |
- git config --global user.email "$${CBMAIL}"
|
| 83 |
- git config --global user.name "Woodpecker CI"
|