From 17893c12ff5fc16e7a18e4b1751087d834f777ec Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:25:06 +0700 Subject: [PATCH] Publish the Wikipedia scope on the wiki --- .github/workflows/pages.yml | 10 ++++++++-- README.md | 2 +- scripts/deploy-cloudflare.sh | 9 +++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index bc0e5b448dc..df0df7645f4 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,7 @@ name: pages # Build the wiki with m2 site build and publish it to https://tamnd.github.io/math2. -# The nightly run picks up changes to the toolchain and the spec in tamnd/math2-agent. +# The nightly run picks up changes to the toolchain and the spec in tamnd/math2-agent, and to the Wikipedia scope in tamnd/wikipedia-math. on: push: branches: [main] @@ -33,6 +33,12 @@ jobs: repository: tamnd/math2-agent ref: main path: toolchain + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + repository: tamnd/wikipedia-math + ref: main + path: wikipedia - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: toolchain/go.mod @@ -44,7 +50,7 @@ jobs: env: COMMIT: ${{ github.sha }} run: | - "$RUNNER_TEMP/m2" site build -content content -spec toolchain/spec -out _site -url https://tamnd.github.io/math2 -commit "$COMMIT" -date now + "$RUNNER_TEMP/m2" site build -content content -spec toolchain/spec -wikipedia wikipedia -out _site -url https://tamnd.github.io/math2 -commit "$COMMIT" -date now - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: path: _site diff --git a/README.md b/README.md index dc7d69b9167..193b7ef31ef 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Each node is one file. A node is a concept, a definition, a statement, a conject The toolchain that builds and checks this content is in [tamnd/math2-agent](https://github.com/tamnd/math2-agent). -Read the content as a wiki at https://math2.tamnd.com. Each node has a page for people and a copy for programs: Markdown, JSON and `llms.txt`. A build server runs `scripts/deploy-cloudflare.sh` every 5 minutes, and it publishes the wiki to Cloudflare Pages when `main` of this repository or of tamnd/math2-agent changes. A change on `main` is on the wiki in 5 to 10 minutes. A mirror of the wiki is at https://tamnd.github.io/math2. The workflow `pages` builds it on GitHub Actions on each push to `main` and each night, so it can be some hours behind. +Read the content as a wiki at https://math2.tamnd.com. Each node has a page for people and a copy for programs: Markdown, JSON and `llms.txt`. A build server runs `scripts/deploy-cloudflare.sh` every 5 minutes, and it publishes the wiki to Cloudflare Pages when `main` of this repository, of tamnd/math2-agent or of tamnd/wikipedia-math changes. The page Wikipedia scope shows the articles that the Wikipedia corpus takes, from [tamnd/wikipedia-math](https://github.com/tamnd/wikipedia-math). A change on `main` is on the wiki in 5 to 10 minutes. A mirror of the wiki is at https://tamnd.github.io/math2. The workflow `pages` builds it on GitHub Actions on each push to `main` and each night, so it can be some hours behind. ## Status diff --git a/scripts/deploy-cloudflare.sh b/scripts/deploy-cloudflare.sh index e2c2d697b94..c3be285614f 100755 --- a/scripts/deploy-cloudflare.sh +++ b/scripts/deploy-cloudflare.sh @@ -1,7 +1,7 @@ #!/bin/sh # Build the wiki of tamnd/math2 and publish it to Cloudflare Pages at https://math2.tamnd.com. # -# Run it from cron on a build server, for example every 5 minutes: */5 * * * * $HOME/math2-deploy/deploy-cloudflare.sh >> $HOME/math2-deploy/deploy.log 2>&1. The server needs git, Go, Node and flock. It fetches main of tamnd/math2 and tamnd/math2-agent, and it does nothing when the two commits are the same as at the last deploy. Use -f to deploy again. +# Run it from cron on a build server, for example every 5 minutes: */5 * * * * $HOME/math2-deploy/deploy-cloudflare.sh >> $HOME/math2-deploy/deploy.log 2>&1. The server needs git, Go, Node and flock. It fetches main of tamnd/math2, tamnd/math2-agent and tamnd/wikipedia-math, and it does nothing when the three commits are the same as at the last deploy. Use -f to deploy again. # # The file $M2_DEPLOY/cloudflare.env must set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. Keep it at mode 600. set -eu @@ -33,15 +33,16 @@ sync() { content=$(sync content math2) toolchain=$(sync toolchain math2-agent) -state="$content $toolchain" +wikipedia=$(sync wikipedia wikipedia-math) +state="$content $toolchain $wikipedia" if [ "$force" != "-f" ] && [ -f "$dir/deployed" ] && [ "$(cat "$dir/deployed")" = "$state" ]; then exit 0 fi -echo "$(date -u +%FT%TZ) deploy math2 $content, math2-agent $toolchain" +echo "$(date -u +%FT%TZ) deploy math2 $content, math2-agent $toolchain, wikipedia-math $wikipedia" (cd "$dir/toolchain" && go build -trimpath -o "$dir/m2" ./cmd/m2) rm -rf "$dir/site" -"$dir/m2" site build -content "$dir/content" -spec "$dir/toolchain/spec" -out "$dir/site" -url "$url" -commit "$content" -date now -cloudflare +"$dir/m2" site build -content "$dir/content" -spec "$dir/toolchain/spec" -wikipedia "$dir/wikipedia" -out "$dir/site" -url "$url" -commit "$content" -date now -cloudflare files=$(find "$dir/site" -type f | wc -l) big=$(find "$dir/site" -type f -size +24M | head -1) if [ "$files" -gt "$limit" ] || [ -n "$big" ]; then