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
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
25
infra/deploy.sh.j2
Normal file
25
infra/deploy.sh.j2
Normal 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."
|
||||
Reference in New Issue
Block a user