From 0ae29b5423ae1cea6926f460b1b740ac1b00e009 Mon Sep 17 00:00:00 2001 From: kathleen Date: Thu, 19 Nov 2026 16:36:08 +0000 Subject: [PATCH] Publish the built site to a `pages` branch for Ken's server to serve (#27) Every push to main builds the static site (npm run build -> dist/) and force-pushes it as the only commit of the `pages` branch. Ken's web server serves that branch (a git-sync sidecar or a pull on a timer): nothing on his server needs a secret, since the repository is public, and the site updates within minutes of every merge, data PRs included. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ --- .gitea/workflows/pages.yml | 37 +++++++++++++++++++++++++++++++++++++ forge.yaml | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/pages.yml diff --git a/.gitea/workflows/pages.yml b/.gitea/workflows/pages.yml new file mode 100644 index 0000000..4e05a40 --- /dev/null +++ b/.gitea/workflows/pages.yml @@ -0,0 +1,37 @@ +# The published Atlas page. Every push to main builds the static site (npm run build -> dist/) and force-pushes it +# as the single commit of the `pages` branch. Ken's server serves that branch as plain files (a web server whose +# folder is kept in step with the branch: a git-sync sidecar, or `git pull` on a timer). The repository is public, +# so his server needs no token. Only the build output is on `pages`, never the raw data. +# +# Secrets: ATLAS_BOT_TOKEN (as in update-sources.yml), to push the branch. +name: Publish the site (pages branch) +on: + push: + branches: [main] + workflow_dispatch: +concurrency: + group: pages + cancel-in-progress: true +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm run build + - name: Push dist/ as the pages branch + env: + ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }} + run: | + cd dist + git init -q -b pages + git config user.name "Atlas data bot" + git config user.email "atlas-bot@noreply.localhost" + git add -A + git commit -q -m "site built from ${GITHUB_SHA::8}" + GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.https://git.kenschiano.net/.extraheader" \ + GIT_CONFIG_VALUE_0="AUTHORIZATION: token $ATLAS_BOT_TOKEN" \ + git push -q -f "https://git.kenschiano.net/${GITHUB_REPOSITORY}.git" pages + echo "pages branch updated from ${GITHUB_SHA::8}" diff --git a/forge.yaml b/forge.yaml index 0790b40..0c1ec52 100644 --- a/forge.yaml +++ b/forge.yaml @@ -13,8 +13,8 @@ branch: main # public, limited (only people signed in to this server) or private: who can open the links below visibility: limited -# the published page, when it is hosted somewhere (GitHub Pages is paused while the GitHub account is suspended; -# the page is viewed locally or as a Claude artifact meanwhile) +# the published page: Ken's server serves the `pages` branch (.gitea/workflows/pages.yml). Set this to its address +# once it is up (then `python -m collection build`): the page's links and the dataset metadata use it. site: null # other copies of the repository (informational)