Files
validation-lab-site/.gitea/workflows/deploy.yaml
T

35 lines
1.2 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:
# per-box label: this repo's builds land on the runner that serves
# validationlab.eu (its /srv/site bind is THIS box's publish root)
runs-on: validationlab-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