ec125261e4
Deploy Vault CMS / deploy (push) Successful in 1m15s
- Build Next.js as a standalone server and copy only that into the runtime image, instead of the whole node_modules tree - Mark three dynamic file reads with turbopackIgnore so the standalone trace does not pull in the entire project - Deploy workflow prunes unused images and build cache older than a day at the start and end of every run, including failed ones, and logs disk usage before building Failed builds were leaving their layers behind until the server's disk filled, which broke the deploy, the database and Gitea sign-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Deploy Vault CMS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
volumes:
|
|
- /opt:/opt
|
|
|
|
steps:
|
|
- name: Deploy
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
|
|
cd /opt/owicms-src
|
|
|
|
# Force the checkout to match the remote exactly, discarding any
|
|
# local modifications (a plain pull can keep or merge tampered files)
|
|
git fetch origin
|
|
git reset --hard origin/master
|
|
|
|
cd /opt/owicms
|
|
|
|
# Clean up afterwards whether or not the deploy succeeds; otherwise
|
|
# every failed build leaves its layers behind until the disk fills.
|
|
# Build cache used in the last day is kept, so routine deploys stay fast.
|
|
cleanup() {
|
|
docker image prune -f || true
|
|
docker builder prune -af --filter until=24h || true
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
# Start from a clean slate too, in case an earlier run was killed.
|
|
cleanup
|
|
|
|
echo "Disk before build:"
|
|
df -h /opt || true
|
|
docker system df || true
|
|
|
|
docker compose up -d --build |