Compare commits
4
Commits
9b2ae99df6
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab87001c77 | ||
|
|
ef4db213c7 | ||
|
|
9ba09fb55b | ||
|
|
4b4e31a55f |
@@ -50,13 +50,17 @@ jobs:
|
||||
|
||||
- name: Health check (retries for ~30s)
|
||||
run: |
|
||||
for i in $(seq 1 6); do
|
||||
if docker exec robot-market wget -qO- --timeout=5 http://localhost:3000 > /dev/null 2>&1; then
|
||||
for i in $(seq 1 15); do
|
||||
if docker exec robot-market node -e "
|
||||
require('http').get('http://localhost:3000', res => {
|
||||
process.exit(res.statusCode < 400 ? 0 : 1);
|
||||
}).on('error', () => process.exit(1));
|
||||
" 2>/dev/null; then
|
||||
echo "Container is healthy"
|
||||
exit 0
|
||||
fi
|
||||
echo "Not ready yet, retrying..."
|
||||
sleep 5
|
||||
sleep 2
|
||||
done
|
||||
echo "Health check failed after 30s"
|
||||
exit 1
|
||||
@@ -74,8 +78,22 @@ jobs:
|
||||
echo "No previous deploy recorded — nothing to roll back to."
|
||||
fi
|
||||
|
||||
- name: Clean up dangling (untagged) layers only
|
||||
- name: Clean up dangling (untagged) layers
|
||||
run: docker image prune -f
|
||||
# Note: this does NOT remove SHA-tagged images, so rollback targets
|
||||
# stay available. Periodically clean up old SHA tags manually if
|
||||
# disk usage grows (e.g. keep the last 10 builds).
|
||||
|
||||
- name: Prune old SHA-tagged images (keep last 5)
|
||||
run: |
|
||||
KEEP=5
|
||||
CURRENT_TAG=$(grep IMAGE_TAG /opt/robot-market-front/.env 2>/dev/null | cut -d= -f2)
|
||||
PREVIOUS_TAG=$(grep IMAGE_TAG /opt/robot-market-front/.env.previous 2>/dev/null | cut -d= -f2)
|
||||
|
||||
docker images robot-market --format '{{.Tag}} {{.CreatedAt}}' \
|
||||
| sort -t" " -k2 -r \
|
||||
| tail -n +$((KEEP + 1)) \
|
||||
| cut -f1 \
|
||||
| while read -r tag; do
|
||||
if [ "$tag" != "$CURRENT_TAG" ] && [ "$tag" != "$PREVIOUS_TAG" ] && [ "$tag" != "<none>" ]; then
|
||||
echo "Removing old image robot-market:$tag"
|
||||
docker rmi "robot-market:$tag" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
+2
-2
@@ -9,8 +9,8 @@ const machinesFa = [
|
||||
id: 'rm-35',
|
||||
name: 'روبات مارکت ۳۵ کانال',
|
||||
shortLabel: '۳۵ کانال',
|
||||
priceLabel: '4,180,000,000 ریال',
|
||||
priceNumeric: 4180000000,
|
||||
priceLabel: '4,200,000,000 ریال',
|
||||
priceNumeric: 4200000000,
|
||||
description: 'یخچالدار، ۳۵ کانال اختصاصی، سیستم خنککننده قدرتمند، تحویل نرم، مدیریت آنلاین ۲۴ ساعته.',
|
||||
highlights: ['یخچالدار', '۳۵ کانال اختصاصی', 'تحویل نرم', 'مدیریت آنلاین ۲۴ ساعته'],
|
||||
image: '/images/machine-35-base.webp',
|
||||
|
||||
Reference in New Issue
Block a user