Compare commits

..
4 Commits
Author SHA1 Message Date
Ryan ab87001c77 fix:refactored workflow to remove old docker image
Build & Deploy (develop) / build-and-deploy (push) Successful in 1m40s
Runner Test / hello (push) Successful in 4s
2026-09-07 09:16:35 +03:30
Ryan ef4db213c7 test: testing ci/cd
Build & Deploy (develop) / build-and-deploy (push) Successful in 1m40s
Runner Test / hello (push) Successful in 4s
2026-09-07 08:33:08 +03:30
Ryan 9ba09fb55b fix:changed hleath check logic
Build & Deploy (develop) / build-and-deploy (push) Successful in 10s
2026-09-07 08:27:12 +03:30
Ryan 4b4e31a55f fix:increased health check retires on workflow
Build & Deploy (develop) / build-and-deploy (push) Failing after 3m2s
2026-09-07 08:20:44 +03:30
2 changed files with 27 additions and 9 deletions
+25 -7
View File
@@ -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
View File
@@ -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',