Files
adamfandClaude Opus 5.5 bfe2fe2782
Test and deploy / test (push) Successful in 1m29s
Test and deploy / deploy (push) Successful in 2s
Rename the repo to adamf/stpweb
Point CI, Renovate, the CV links, tests and docs at adamf/stpweb and
the deploy folder at ~/deploy/stpweb. Pin the Compose project name to
web_server so the existing volumes and network keep their names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 20:54:30 +00:00

56 lines
1.9 KiB
YAML

name: Weekly Maintenance
on:
schedule:
# Restarts dockerd, so it runs when nobody is likely mid-edit.
- cron: "0 5 * * 0"
workflow_dispatch:
jobs:
maintenance:
runs-on: self-hosted
steps:
- name: Show disk usage before
run: df -h /
- name: Update apt package index
run: sudo apt-get update
- name: Upgrade system packages
run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
- name: Autoremove obsolete packages
run: sudo apt-get -y autoremove --purge
# .compose.lock is shared with deploy.yaml, so two compose runs
# never race. Taken per step to keep deploys from waiting long.
- name: Pull latest base images
working-directory: /home/adamf/deploy/stpweb
run: flock .compose.lock docker compose pull
- name: Rebuild and restart containers
working-directory: /home/adamf/deploy/stpweb
run: flock .compose.lock docker compose up -d --build --remove-orphans
- name: Prune unused Docker images
run: docker image prune -af
- name: Prune old Docker build cache
run: docker builder prune -f --filter until=336h
- name: Show running containers
run: docker compose ps
working-directory: /home/adamf/deploy/stpweb
- name: Show disk usage after
run: df -h /
- name: Reboot if required
run: |
if [ -f /var/run/reboot-required ]; then
echo "Reboot required — scheduling in 1 minute"
sudo shutdown -r +1
else
echo "No reboot needed"
fi