# 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}"