# Builds the Zensical documentation strictly (a broken link or a page missing from the navigation fails the job) and, # on main, copies it to /srv/www/docs/paperspec, which serves https://docs.scient.ing/paperspec/. # The linux-base runner mounts the host's /srv/www into its job containers, so publishing is a local copy. name: docs on: push: branches: [main, dev] paths: - "docs/**" - "zensical.toml" - "README.md" - "CHANGELOG.md" - "src/**" - ".gitea/workflows/docs.yml" workflow_dispatch: permissions: contents: read concurrency: group: docs-${{ gitea.ref }} cancel-in-progress: true defaults: run: shell: bash env: SITE_ROOT: /srv/www/docs SITE_SLUG: paperspec jobs: docs: runs-on: linux-base container: image: git.scient.ing/infra/linux-base:26.10.7 timeout-minutes: 15 steps: - uses: actions/checkout@v4 with: persist-credentials: false - name: Build the documentation, strictly run: pixi run --locked -e docs docs-build - name: Publish the documentation if: github.ref == 'refs/heads/main' run: | if [ ! -d "$SITE_ROOT" ]; then echo "$SITE_ROOT is not mounted on this runner, so the docs were built but not published." exit 0 fi case "$SITE_SLUG" in ''|*/*|.*) echo "SITE_SLUG must be a plain folder name, not '$SITE_SLUG'." >&2; exit 1 ;; esac if [ ! -f build/docs/index.html ] || [ ! -f build/docs/404.html ]; then echo "build/docs has no index.html or 404.html, so it was not published." >&2 exit 1 fi # Same copy as the other studio sites: unchanged files keep their Last-Modified and ETag, and the # changes apply together at the end of the copy. rsync --recursive --links --perms --chmod=D755,F644 --checksum --delay-updates --delete-delay --stats \ build/docs/ "$SITE_ROOT/$SITE_SLUG/"