Compare commits
4
Commits
9b2ae99df6
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab87001c77 | ||
|
|
ef4db213c7 | ||
|
|
9ba09fb55b | ||
|
|
4b4e31a55f |
@@ -50,13 +50,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Health check (retries for ~30s)
|
- name: Health check (retries for ~30s)
|
||||||
run: |
|
run: |
|
||||||
for i in $(seq 1 6); do
|
for i in $(seq 1 15); do
|
||||||
if docker exec robot-market wget -qO- --timeout=5 http://localhost:3000 > /dev/null 2>&1; then
|
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"
|
echo "Container is healthy"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Not ready yet, retrying..."
|
echo "Not ready yet, retrying..."
|
||||||
sleep 5
|
sleep 2
|
||||||
done
|
done
|
||||||
echo "Health check failed after 30s"
|
echo "Health check failed after 30s"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -74,8 +78,22 @@ jobs:
|
|||||||
echo "No previous deploy recorded — nothing to roll back to."
|
echo "No previous deploy recorded — nothing to roll back to."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Clean up dangling (untagged) layers only
|
- name: Clean up dangling (untagged) layers
|
||||||
run: docker image prune -f
|
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
|
- name: Prune old SHA-tagged images (keep last 5)
|
||||||
# disk usage grows (e.g. keep the last 10 builds).
|
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',
|
id: 'rm-35',
|
||||||
name: 'روبات مارکت ۳۵ کانال',
|
name: 'روبات مارکت ۳۵ کانال',
|
||||||
shortLabel: '۳۵ کانال',
|
shortLabel: '۳۵ کانال',
|
||||||
priceLabel: '4,180,000,000 ریال',
|
priceLabel: '4,200,000,000 ریال',
|
||||||
priceNumeric: 4180000000,
|
priceNumeric: 4200000000,
|
||||||
description: 'یخچالدار، ۳۵ کانال اختصاصی، سیستم خنککننده قدرتمند، تحویل نرم، مدیریت آنلاین ۲۴ ساعته.',
|
description: 'یخچالدار، ۳۵ کانال اختصاصی، سیستم خنککننده قدرتمند، تحویل نرم، مدیریت آنلاین ۲۴ ساعته.',
|
||||||
highlights: ['یخچالدار', '۳۵ کانال اختصاصی', 'تحویل نرم', 'مدیریت آنلاین ۲۴ ساعته'],
|
highlights: ['یخچالدار', '۳۵ کانال اختصاصی', 'تحویل نرم', 'مدیریت آنلاین ۲۴ ساعته'],
|
||||||
image: '/images/machine-35-base.webp',
|
image: '/images/machine-35-base.webp',
|
||||||
|
|||||||
Reference in New Issue
Block a user