Bernt Christian Egeland пре 1 месец
родитељ
комит
34c33e8895
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      .github/workflows/deploy-staging.yml

+ 4 - 1
.github/workflows/deploy-staging.yml

@@ -101,7 +101,10 @@ jobs:
           DB_NAME=$(echo "$DATABASE_URL" | sed -E 's|.*/([^/?]+)(\?.*)?$|\1|')
 
           BACKUP_DIR="${{ secrets.DATA_PATH }}/db-backups/staging"
-          mkdir -p "$BACKUP_DIR"
+          # The volume is root-owned and the runner is not root. Binding the
+          # path into a container makes Docker create it, and the chown hands
+          # it to the runner so the dump redirect below can write there.
+          docker run --rm -v "$BACKUP_DIR":/b alpine chown "$(id -u):$(id -g)" /b
 
           # The Postgres data directory lives on this same filesystem, so filling
           # it takes the database down rather than merely losing the backup.