Files
site/.gitea/workflows/deploy.yaml
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

33 lines
1.0 KiB
YAML

# The editable-site pipeline: every push to main builds the astro site
# and swaps it into the publish directory Caddy serves (astro.<base> +
# the APEX + www). The runner binds /var/lib/astro-site into the job
# container at /srv/site (see the app tree's deploy-backend extras
# module). This file rides the SITE REPO (pushed by the bootstrap's E5)
# — the paths are this repo's root, not an enclosing app tree.
name: deploy
on:
push:
branches: [main]
jobs:
build-and-publish:
runs-on: node
steps:
- uses: actions/checkout@v4
- name: Build the site
run: |
npm ci
npm run build
- name: Publish (atomic dir swap)
run: |
set -euo pipefail
rm -rf /srv/site/current.new
cp -r dist /srv/site/current.new
rm -rf /srv/site/current.old
if [ -d /srv/site/current ]; then mv /srv/site/current /srv/site/current.old; fi
mv /srv/site/current.new /srv/site/current
rm -rf /srv/site/current.old