Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit 02c917b

Browse files
feat: make deploy.yml fully idempotent and update README mkdir command (#4)
Agent-Logs-Url: https://github.com/rsantamaria01/arrs-media-server/sessions/198a87d4-6b78-4ea0-a467-3078b95790b9 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rsantamaria01 <50458018+rsantamaria01@users.noreply.github.com>
1 parent f0f3855 commit 02c917b

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,29 @@ jobs:
1818
username: ${{ secrets.DO_USER }}
1919
password: ${{ secrets.DO_PASSWORD }}
2020
script: |
21+
if ! command -v docker &> /dev/null; then
22+
apt-get update
23+
apt-get install -y docker.io docker-compose
24+
fi
25+
26+
if ! command -v docker-compose &> /dev/null; then
27+
apt-get install -y docker-compose
28+
fi
29+
30+
if [ ! -d "/opt/mediastack/.git" ]; then
31+
git clone https://github.com/rsantamaria01/arrs-media-server.git /opt/mediastack
32+
else
33+
cd /opt/mediastack && git pull origin main
34+
fi
35+
36+
if [ ! -f "/opt/mediastack/.env" ]; then
37+
printf 'PUID=0\nPGID=0\nTZ=America/New_York\n' > /opt/mediastack/.env
38+
fi
39+
40+
mkdir -p /opt/mediastack/services/{prowlarr,sonarr,sonarr-anime,radarr,lidarr,mylar3,kavita,bazarr,jellyfin,npm/data,npm/letsencrypt}
41+
2142
cd /opt/mediastack
22-
git pull origin main
23-
mkdir -p services/{prowlarr,sonarr,sonarr-anime,radarr,lidarr,readarr,bazarr,jellyfin,npm/data,npm/letsencrypt}
24-
docker compose pull
25-
docker compose up -d --remove-orphans
43+
docker-compose pull
44+
docker-compose up -d --remove-orphans
45+
46+
docker image prune -f

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A production-ready, self-hosted media automation stack built with Docker Compose
3535
Bind mounts require the host directories to exist before starting the stack:
3636

3737
```bash
38-
mkdir -p services/{prowlarr,sonarr,sonarr-anime,radarr,lidarr,kavita,mylar3,bazarr,jellyfin,npm/data,npm/letsencrypt}
38+
mkdir -p services/{prowlarr,sonarr,sonarr-anime,radarr,lidarr,mylar3,kavita,bazarr,jellyfin,npm/data,npm/letsencrypt}
3939
```
4040

4141
4. **Start the stack**
@@ -75,10 +75,9 @@ Add the following secrets in your repository under **Settings → Secrets and va
7575

7676
### Environment File
7777

78-
The `.env` file is **not** committed to the repository. It must be created manually on the droplet before the first deployment:
78+
The `.env` file is **not** committed to the repository. The deploy script automatically creates it with default values (`PUID=0`, `PGID=0`, `TZ=America/New_York`) on first run if it does not already exist. To customise, edit it on the droplet after the first deployment:
7979

8080
```bash
8181
# On the droplet
82-
cp /opt/mediastack/.env.example /opt/mediastack/.env
83-
# Then edit /opt/mediastack/.env to set PUID, PGID, TZ, etc.
82+
nano /opt/mediastack/.env
8483
```

0 commit comments

Comments
 (0)