Enhance deployment scripts by removing old Docker images and pruning unused resources
All checks were successful
Deploy Development / deploy (push) Successful in 2m27s
All checks were successful
Deploy Development / deploy (push) Successful in 2m27s
This commit is contained in:
@@ -47,6 +47,10 @@ jobs:
|
||||
mkdir -p \$DEPLOY_DIR
|
||||
cd /tmp
|
||||
docker load < merchbay.tar.gz
|
||||
|
||||
echo 'Removing old merchbay images'
|
||||
docker images | grep merchbay | grep -v "\$(docker images merchbay:latest -q)" | awk '{print \$3}' | xargs -r docker rmi -f || true
|
||||
|
||||
cp docker-compose.yml \$DEPLOY_DIR/
|
||||
cd \$DEPLOY_DIR
|
||||
|
||||
@@ -67,6 +71,12 @@ jobs:
|
||||
docker compose exec -T app php artisan route:cache
|
||||
docker compose exec -T app php artisan view:cache
|
||||
rm -f /tmp/merchbay.tar.gz /tmp/docker-compose.yml
|
||||
|
||||
echo 'Pruning unused Docker resources'
|
||||
docker image prune -af --filter "until=24h" || true
|
||||
docker container prune -f || true
|
||||
docker system df
|
||||
|
||||
echo 'Production deployment completed successfully!'
|
||||
echo 'Application available at: https://merchbay.app'
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user