created CD pipeline to complement the existing gitea/woodpecker CI pipeline: build, push to registry, deploy to staging on main
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Disco DeDisco
2026-02-13 15:27:59 -05:00
parent e02385118f
commit 510874b87c
7 changed files with 322 additions and 21 deletions

25
infra/deploy.sh.j2 Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail
IMAGE=gitea.earthmanrpg.me/discoman/gamearray:latest
echo "==> Pulling latest image..."
docker pull "$IMAGE"
echo "==> Stopping old container..."
docker stop gamearray 2>/dev/null || true
docker rm gamearray 2>/dev/null || true
echo "==> Starting new container..."
docker run -d --name gamearray \
--env-file /opt/gamearray/gamearray.env \
-p 127.0.0.1:8888:8888 \
"$IMAGE"
echo "==> Running migrations..."
docker exec gamearray ./manage.py migrate
echo "==> Copying static files..."
sudo docker cp gamearray:/src/static/. /var/www/gamearray/static/
echo "==> Deploy complete."