- Rename manuspec to paperspec everywhere outside pixi.toml: prose, the tools, provenance tool names and the fixture key derivations, so every fixture and vector is rebuilt. - Move the namespace addresses under the site, mirroring the repository: schema $id https://paperspec.scient.ing/schemas/<file>, the JSON-LD context https://paperspec.scient.ing/context/scienting-1.jsonld, and term IRIs https://paperspec.scient.ing/vocab#<term>. Format identifiers (scienting-*) and URNs (urn:scienting:) are unchanged. - tools/site.py (standard library only) builds _site/: every file of the repository at its own path, each Markdown file rendered as a page with sidebar navigation, heading anchors matching the forge's, folder listings, a vocabulary page for the context's IRIs, a heading search and a 404 page; light and dark themes. - check.py builds the site and checks that every Markdown file has a page, every internal link and fragment resolves, no Markdown is left unrendered, and every $id, the context address and the vocabulary IRIs are files of the site. - deploy/: a Caddyfile with the media types and CORS the data needs, and a guide; .gitea/workflows/site.yml builds on main and publishes with rsync when the SITE_* secrets are set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
# Builds the website on every push to main and publishes it when the SITE_* secrets are set; see deploy/README.md.
|
|
name: site
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
jobs:
|
|
site:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: prefix-dev/setup-pixi@v0.9.4
|
|
with:
|
|
pixi-version: v0.69.0
|
|
- name: Build the site
|
|
run: pixi run python tools/site.py --out _site
|
|
- name: Publish the site
|
|
env:
|
|
SITE_HOST: ${{ secrets.SITE_HOST }}
|
|
SITE_USER: ${{ secrets.SITE_USER }}
|
|
SITE_PATH: ${{ secrets.SITE_PATH }}
|
|
SITE_SSH_KEY: ${{ secrets.SITE_SSH_KEY }}
|
|
run: |
|
|
if [ -z "$SITE_HOST" ]; then
|
|
echo "SITE_HOST is not set, so the site was built but not published."
|
|
exit 0
|
|
fi
|
|
command -v rsync >/dev/null || (sudo apt-get update && sudo apt-get install -y rsync)
|
|
mkdir -p ~/.ssh
|
|
printf '%s\n' "$SITE_SSH_KEY" > ~/.ssh/site_key
|
|
chmod 600 ~/.ssh/site_key
|
|
ssh-keyscan -H "$SITE_HOST" >> ~/.ssh/known_hosts
|
|
rsync -az --delete -e "ssh -i ~/.ssh/site_key" _site/ "$SITE_USER@$SITE_HOST:$SITE_PATH/"
|