arr-summary/.forgejo/workflows/deploy.yml
Barely Removable 600a48da93
All checks were successful
Deploy / deploy (push) Successful in 21s
Persist settings.json across deploys via a data volume
The previous commit made Settings-saved API keys override .env, but the
key still never survived: settings.json was written to the container
filesystem, and every deploy runs `up -d --build`, which recreates the
container and discards it. Saving a rotated SABnzbd key and restarting
therefore still fell back to the stale .env value.

SETTINGS_FILE is now configurable and pointed at /data/settings.json on
a ./data bind mount, so runtime settings live on the host. The deploy
rsync also excludes data/ — it runs --delete and would otherwise wipe
the directory for not being in the repo, reintroducing the same bug.

This affected everything the Settings page writes, not just API keys:
timezone and a UI-changed login password were being reverted on every
deploy too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 09:34:46 -07:00

33 lines
1.1 KiB
YAML

name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rsync
run: apt-get update -qq && apt-get install -y -qq rsync
# The job container only sees its own checkout — the live app lives
# at /mnt/user/appdata/greendale on the host, bind-mounted into this
# container at the same path (see runner container.options) so
# `docker compose`'s relative paths resolve against the real host
# directory rather than an ephemeral one. `.env` and `data/` are
# server-only state and must survive every deploy — without the
# excludes, --delete removes them because they aren't in the repo.
- name: Sync source to deploy path
run: |
rsync -a --delete \
--exclude='.git' \
--exclude='.env' \
--exclude='data' \
./ /mnt/user/appdata/greendale/
- name: Rebuild and restart
working-directory: /mnt/user/appdata/greendale
run: docker compose up -d --build