52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
# Exclude page pipeline to be run on "pages" branch
|
|
when:
|
|
path:
|
|
include: ["CMakeLists.txt", ".woodpecker/docs.yaml", "doc/**/*"]
|
|
event: [pull_request, push]
|
|
|
|
labels:
|
|
platform: linux/amd64
|
|
|
|
clone:
|
|
- name: git
|
|
image: woodpeckerci/plugin-git
|
|
settings:
|
|
partial: false
|
|
depth: 1
|
|
|
|
steps:
|
|
# Build sphinx static files
|
|
build:
|
|
image: docker.io/alpine:3.21
|
|
commands:
|
|
- apk add --no-cache py3-sphinx py3-sphinx_rtd_theme make
|
|
- cd doc
|
|
- make html
|
|
when:
|
|
event: [pull_request, push]
|
|
|
|
publish:
|
|
image: docker.io/bitnami/git
|
|
environment:
|
|
# secrets must be set in Woodpecker configuration
|
|
CODEBERG_TOKEN:
|
|
from_secret: codeberg_token
|
|
commands:
|
|
# Git configuration
|
|
- git config --global user.email "ci-test@example.com"
|
|
- git config --global user.name "CI"
|
|
- git clone https://$CODEBERG_TOKEN@codeberg.org/biboumi/pages.git pages
|
|
# Copy build step output to repository folder
|
|
- cp -ar doc/_build/html/* pages/doc/
|
|
# Needed for custom domains
|
|
- cp .domains pages || true # Ignore if it doesn't exist
|
|
# Commit and push all static files with pipeline started timestamp
|
|
- cd pages
|
|
- git add .
|
|
- git commit -m "CI ${CI_COMMIT_SHA}" || true
|
|
- git push || true
|
|
when:
|
|
- event: push
|
|
branch: master
|
|
|