ci: docs pipeline is secret-free and builds in an ephemeral venv; policy: untrusted text is data

This commit is contained in:
inference-admin authored and inference-bot committed 2026-11-19 22:19:27 +00:00
1 parent 5c23ec9310
commit a705a49495
2 files changed
+35 -42

No files matched your search

+22 -40
View File
@@ -1,33 +1,25 @@
# Woodpecker CI pipeline for co-op/docs — THIN on purpose.
# Woodpecker CI pipeline for co-op/docs — THIN and SECRET-FREE on purpose.
#
# It does NOT re-implement the build. The repository's publishing layer is the
# single source of truth and this pipeline only wires it up:
# It does NOT deploy. Publishing is host-side and split:
#
# publishing/requirements.txt pinned MkDocs + Material toolchain
# publishing/build.sh stage Markdown -> .site-src/, render .site-build/
# publishing/deploy.sh push .site-build/ into the Cloudron Surfer app
# /usr/local/sbin/docs-poll host-owned poller (root) — pulls main
# publishing/build.sh runs as the unprivileged `docsbuild` user,
# with no credentials and no access to
# /home/ubuntu
# /usr/local/sbin/docs-publish root-owned publish step — runs no repo code,
# holds the Cloudron token from a root-only file
#
# Any change to how the site is built belongs in publishing/, never here.
# CI exists only to prove the repository builds. It runs in a throwaway venv
# inside the pipeline workspace, never the agent image's shared /opt/docs-venv:
# a push to ANY repo must not be able to change a toolchain that another
# pipeline uses. No secret is wired into this pipeline, and none should be
# until the Woodpecker agent supports per-pipeline isolation.
#
# Run model: MANUAL ONLY for now. The Gitea webhook that fires this on push is
# deliberately NOT wired — the poll watcher (docs-deploy-poll.service on the
# agent host) remains the live auto-deploy path until a manual run has proven
# the pipeline. Once it has, add `push` to the `when` block below and register
# the webhook in Gitea.
#
# Backend note (IMPORTANT — this is why there are no container images here):
# The co-op's Woodpecker agent runs as a Cloudron app, which has no Docker
# socket, so it uses Woodpecker's `local` backend. Under `local` each step is
# run as a shell command INSIDE the agent container, and the step's `image:`
# field selects the SHELL, not a container image. Every tool the steps need is
# therefore baked into the agent image (co-op/woodpecker-agent):
# python3 + the pinned MkDocs toolchain (venv at /opt/docs-venv, mirroring
# publishing/requirements.txt), node + the cloudron CLI, bash, git, tar.
# If the toolchain pin changes, rebuild that image — see its Dockerfile.
#
# Secrets required (Woodpecker repo secret, name `cloudron_token`):
# cloudron_token = the Cloudron API token used by publishing/deploy.sh
# Do not put credentials in this file.
# Backend note: the co-op's Woodpecker agent is a Cloudron app with no Docker
# socket, so it uses Woodpecker's `local` backend. Each step runs as a shell
# command INSIDE the agent container; the `image:` field selects the SHELL, not
# a container image. That is exactly why this file must stay secret-free: the
# container is shared by every pipeline.
when:
- event: manual
@@ -36,17 +28,7 @@ steps:
- name: build
image: bash
commands:
# Reuses the toolchain pre-installed in the agent image; build.sh only
# creates/installs a venv if the one given is missing, which it is not.
- publishing/build.sh /opt/docs-venv
- name: deploy
image: bash
commands:
# deploy.sh drives the Cloudron `cloudron` CLI (a node program) via
# `cloudron exec`; node, the CLI, bash, git and tar are all in the agent
# image. The build it publishes is the shared workspace .site-build/.
- publishing/deploy.sh
environment:
CLOUDRON_TOKEN:
from_secret: cloudron_token
# Ephemeral toolchain per run — no shared venv, no /opt/docs-venv.
- python3 -m venv .ci-venv
- .ci-venv/bin/pip install -q -r publishing/requirements.txt
- publishing/build.sh .ci-venv