diff --git a/.github/workflows/casket-pages.yml b/.github/workflows/casket-pages.yml new file mode 100644 index 0000000..c87084b --- /dev/null +++ b/.github/workflows/casket-pages.yml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: MPL-2.0 +# +# GitHub Pages deployment. +# +# This repository has Pages configured with build_type "workflow", but carried +# no Pages workflow — so the build never ran and the site was never published. +# https://hyperpolymath.github.io/nesy-solver/ returned 404 for the site root +# and for /.well-known/security.txt alike. +# +# WHY THIS STAGES A SUBSET RATHER THAN PUBLISHING THE REPOSITORY ROOT +# +# index.html references /public/styles.css and /public/app.js, and the site +# needs .well-known/ at its root. Those three things, plus the entry page, are +# what is staged. Publishing the repository root instead would serve 45 root +# files — AUDIT.adoc, Containerfile, server.js, wrangler.toml and the rest — +# none of which is site content. +name: GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + + - name: Stage the site + run: | + set -euo pipefail + mkdir -p _site + cp index.html _site/index.html + [ -d public ] && cp -r public _site/public + # .well-known/ must sit at the ORIGIN ROOT to be discoverable + # (RFC 8615). nesy-solver.dev does not currently resolve, so nothing + # serves it today; this keeps it correct at whatever origin does. + [ -d .well-known ] && cp -r .well-known _site/.well-known + echo "staged:" + find _site -type f | sed 's/^/ /' + + - name: Setup Pages + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 + with: + path: '_site' + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4