This commit is contained in:
@@ -59,7 +59,6 @@ jobs:
|
|||||||
# --- Sync files ---
|
# --- Sync files ---
|
||||||
- name: Sync files to server
|
- name: Sync files to server
|
||||||
run: |
|
run: |
|
||||||
# Use IPQoS=0x00 to prevent connection drops in some network environments
|
|
||||||
# Use tar to bundle files and send them via SSH in a single connection
|
# Use tar to bundle files and send them via SSH in a single connection
|
||||||
tar czf - docker-compose.yml $([ -d ./varnish ] && echo varnish) | \
|
tar czf - docker-compose.yml $([ -d ./varnish ] && echo varnish) | \
|
||||||
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 deploy@alpha.mintel.me \
|
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 deploy@alpha.mintel.me \
|
||||||
@@ -73,19 +72,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 deploy@alpha.mintel.me "
|
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IPQoS=0x00 deploy@alpha.mintel.me "
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo 'Logging in to registry on server...'
|
echo 'Logging in to registry on server...'
|
||||||
echo '$REGISTRY_PASS' | docker login registry.infra.mintel.me -u '$REGISTRY_USER' --password-stdin
|
echo '$REGISTRY_PASS' | docker login registry.infra.mintel.me -u '$REGISTRY_USER' --password-stdin
|
||||||
|
|
||||||
cd /home/deploy/sites/klz-cables.com
|
cd /home/deploy/sites/klz-cables.com
|
||||||
|
|
||||||
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" > .env
|
echo 'Creating .env if needed...'
|
||||||
|
echo 'SENTRY_DSN=${{ secrets.SENTRY_DSN }}' > .env
|
||||||
echo 'Pulling latest images...'
|
|
||||||
docker compose pull
|
echo 'Pulling latest image...'
|
||||||
|
docker compose pull app || echo 'Pull failed - continuing anyway...'
|
||||||
echo 'Updating containers...'
|
|
||||||
docker compose up -d
|
echo 'Force recreating and restarting app container...'
|
||||||
|
docker compose up -d --force-recreate --no-deps app
|
||||||
echo 'Pruning old images...'
|
|
||||||
docker image prune -f
|
echo 'Pruning old images (keep last 24h)...'
|
||||||
"
|
docker image prune -f --filter 'until=24h'
|
||||||
|
|
||||||
|
echo 'Deployment finished. Checking status...'
|
||||||
|
docker compose ps app
|
||||||
|
docker compose logs --tail=20 app
|
||||||
|
"
|
||||||
Reference in New Issue
Block a user