From d5e988cfdd7a55be83256d2df19cb2ad4c2ca4ee Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Thu, 17 Apr 2025 14:55:22 +0200 Subject: [PATCH] feat: add documentation generation workflow To fully automate deployment of documentation pages to codeberg pages a woodpecker CI file containing the build instruction is made. This needs to install all of biboumi's dependencies as to work with cmake, then generate the makefiles, and finally the actual documentation as HTML. Once that's done, push everything to a `pages` branch. --- .woodpecker/docs.yaml | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .woodpecker/docs.yaml diff --git a/.woodpecker/docs.yaml b/.woodpecker/docs.yaml new file mode 100644 index 0000000..bcde03e --- /dev/null +++ b/.woodpecker/docs.yaml @@ -0,0 +1,52 @@ +# Exclude page pipeline to be run on "pages" branch +when: + branch: + exclude: pages + event: [push, pull_request] + +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: + # Must install all of biboumi's dependencies to satisfy cmake + - apk add --no-cache --virtual .build py3-sphinx py3-sphinx_rtd_theme cmake expat-dev g++ git libidn-dev make postgresql-dev python3 sqlite-dev udns-dev util-linux-dev botan-dev + - mkdir -p build + - cd build + - cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_BOTAN=1 -DWITH_SQLITE3=1 -DWITH_LIBIDN=1 -DWITH_POSTGRESQL=1 + - make html + when: + event: [pull_request, push] + + publish: + image: docker.io/bitnami/git + environment: + # secrets must be set in Woodpecker configuration + MAIL: + from_secret: mail + CODEBERG_TOKEN: + from_secret: codeberg_token + commands: + # Git configuration + - git config --global user.email $MAIL + - git config --global user.name "CI" + - git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME + # Copy build step output to repository folder + - cp -ar build/html $CI_REPO_NAME/ + # Needed for custom domains + - cp .domains $CI_REPO_NAME || true # Ignore if it doesn't exist + # Commit and push all static files with pipeline started timestamp + - cd $CI_REPO_NAME + - git add . + - git commit -m "CI ${CI_COMMIT_SHA}" + - git push + when: + event: push +