Skip to content

Commit 648ab76

Browse files
chrisbbreuerclaude
andcommitted
fix: resolve git ownership issue in registry deploy
git pull was silently failing because the repo at /opt/pantry-registry/repo is owned by root but the SSH user is ec2-user. Added safe.directory config and use sudo for git pull and bun install. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf167a5 commit 648ab76

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

.github/workflows/deploy-registry.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,18 @@ jobs:
2828
ssh-keyscan -H 54.243.196.101 >> ~/.ssh/known_hosts 2>/dev/null
2929
3030
ssh -o StrictHostKeyChecking=no ec2-user@54.243.196.101 << 'EOF'
31+
set -e
3132
cd /opt/pantry-registry/repo
32-
git pull origin main
33-
cd packages/registry
3433
35-
# Debug: check what systemd runs and if dashboard files exist
36-
echo "=== systemd service ==="
37-
sudo systemctl cat pantry-registry 2>/dev/null || echo "No systemd unit found"
38-
echo "=== dashboard files ==="
39-
ls -la dashboard/pages/ 2>/dev/null || echo "No dashboard directory"
40-
echo "=== server.ts dashboard route check ==="
41-
grep -c "handleDashboard\|/dashboard" src/server.ts || echo "No dashboard routes"
34+
# Fix git ownership (repo owned by root, SSH user is ec2-user)
35+
git config --global --add safe.directory /opt/pantry-registry/repo
4236
43-
~/.bun/bin/bun install --production
37+
sudo git pull origin main
38+
cd packages/registry
39+
sudo /root/.bun/bin/bun install --production
4440
sudo systemctl restart pantry-registry
4541
sleep 2
46-
echo "=== local health check ==="
4742
curl -sf http://localhost:3000/health || echo "Health check failed"
48-
echo ""
49-
echo "=== local dashboard check ==="
50-
curl -sf -o /dev/null -w "HTTP %{http_code}" http://localhost:3000/dashboard || echo " - Dashboard failed"
51-
echo ""
52-
echo "=== local dashboard/login check ==="
53-
curl -sf http://localhost:3000/dashboard/login 2>/dev/null | head -5 || echo "Login page failed"
5443
EOF
5544
5645
- name: Verify deployment

0 commit comments

Comments
 (0)