All checks were successful
Deploy c4 / deploy (push) Successful in 41s
On a fresh VM, Docker creates the bind-mounted data/ directory as root:root, but the container runs as games (UID 5). This causes SQLite to fail with SQLITE_CANTOPEN. Create the directory with correct ownership in the deploy pipeline.
29 lines
674 B
YAML
29 lines
674 B
YAML
name: Deploy c4
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
DEPLOY_DIR: /home/ryan/c4
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Sync to deploy directory
|
|
run: |
|
|
mkdir -p $DEPLOY_DIR
|
|
rsync -a --delete --exclude 'data/' . $DEPLOY_DIR/
|
|
|
|
- name: Ensure data directory exists with correct ownership
|
|
run: |
|
|
mkdir -p $DEPLOY_DIR/data
|
|
# UID 5 / GID 60 = games:games in the container (debian:bookworm-slim)
|
|
sudo chown 5:60 $DEPLOY_DIR/data
|
|
|
|
- name: Rebuild and restart
|
|
run: cd $DEPLOY_DIR && docker compose up -d --build --remove-orphans
|