# The project site (docs/milestones/W1.md): built with Zola to see that it builds and that its pages # are sound. Publishing is the maintainer's: the web server pulls main and runs `zola build`. # # It runs when the site, or a document the site is built from, changes (a pull request, or a push to # main); the firmware workflow (ci.yml) skips a change that touches only these files. A change that # touches both runs both. src/main.cpp is here too: the site's command reference is generated from the # firmware's own `help` text, and this job checks that it is still current. name: Site on: push: branches: [main] paths: ['site/**', 'docs/**', 'README.md', 'CONTEXT.md', 'src/main.cpp', '.gitea/workflows/site.yml'] pull_request: paths: ['site/**', 'docs/**', 'README.md', 'CONTEXT.md', 'src/main.cpp', '.gitea/workflows/site.yml'] jobs: build: runs-on: ubuntu # A pull request from a fork would run someone else's code on our runner: not without us. if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository container: image: python:3.12-slim steps: - name: Tools run: | apt-get update -qq apt-get install -y -qq --no-install-recommends git ca-certificates curl >/dev/null # Zola, pinned by its checksum. curl -fsSL -o /tmp/zola.tgz https://github.com/getzola/zola/releases/download/v0.22.0/zola-v0.22.0-x86_64-unknown-linux-gnu.tar.gz echo "f1d491f8956b94384c27d75cb6b2bf60d3916d1ade9564bcbfe7c03f0258aebf /tmp/zola.tgz" | sha256sum -c - tar xzf /tmp/zola.tgz -C /usr/local/bin zola zola --version - name: Check out run: | find . -mindepth 1 -maxdepth 1 -exec rm -rf {} + git config --global --add safe.directory '*' git init -q . git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" git fetch -q origin '+refs/heads/*:refs/remotes/origin/*' '+refs/pull/*/head:refs/remotes/pull/*' git checkout -q --detach "${{ github.sha }}" - name: The generated developer pages are current run: python3 site/tools/gen_dev_docs.py --check - name: Build the site run: | cd site zola check --skip-external-links zola build --output-dir /tmp/site-out - name: Check the pages run: python3 site/tools/check_site.py /tmp/site-out