diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml
index 539d2d4..e50d5d3 100644
--- a/.gitea/workflows/deploy.yml
+++ b/.gitea/workflows/deploy.yml
@@ -24,5 +24,22 @@ jobs:
echo "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p 2234 -H 172.17.0.1 >> ~/.ssh/known_hosts
- - name: Deploy
- run: ssh -p 2234 devops@172.17.0.1 'bash /opt/services/parsa/frontend/deploy.sh'
+ - name: Deploy reviewed scoped frontend release
+ env:
+ RELEASE_SHA: ${{ gitea.sha }}
+ run: |
+ case "$RELEASE_SHA" in ''|*[!0-9a-f]*) exit 1;; esac
+ test "${#RELEASE_SHA}" = 40
+ ssh -p 2234 devops@172.17.0.1 "bash -s -- $RELEASE_SHA" <<'REMOTE'
+ set -euo pipefail
+ expected=$1
+ cd /opt/services/parsa/frontend/repo
+ test -z "$(git status --porcelain --untracked-files=normal)"
+ export GIT_SSH_COMMAND='ssh -i /home/devops/.ssh/deploy_key -o StrictHostKeyChecking=no'
+ git fetch origin main
+ test "$(git rev-parse origin/main)" = "$expected"
+ git merge --ff-only "$expected"
+ bash -n ops/deploy-frontend.sh
+ sudo install -m 0755 ops/deploy-frontend.sh /opt/services/parsa/frontend/deploy.sh
+ bash /opt/services/parsa/frontend/deploy.sh "$expected"
+ REMOTE
diff --git a/ops/Dockerfile b/ops/Dockerfile
new file mode 100644
index 0000000..a949169
--- /dev/null
+++ b/ops/Dockerfile
@@ -0,0 +1,16 @@
+FROM node:22-alpine AS builder
+WORKDIR /app
+COPY package.json package-lock.json ./
+RUN npm ci --ignore-scripts --registry=https://registry.npmjs.org
+COPY . .
+ENV NEXT_TELEMETRY_DISABLED=1
+RUN npm run build
+FROM node:22-alpine
+WORKDIR /app
+ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=3000 HOSTNAME=0.0.0.0
+COPY --from=builder /app/public ./public
+COPY --from=builder /app/.next/standalone ./
+COPY --from=builder /app/.next/static ./.next/static
+USER node
+EXPOSE 3000
+CMD ["node", "server.js"]
diff --git a/ops/deploy-frontend.sh b/ops/deploy-frontend.sh
new file mode 100644
index 0000000..8083e0e
--- /dev/null
+++ b/ops/deploy-frontend.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -euo pipefail
+expected=${1:?immutable revision required}
+[[ "$expected" =~ ^[0-9a-f]{40}$ ]]
+cd /opt/services/parsa/frontend/repo
+test "$(git rev-parse HEAD)" = "$expected"
+test -z "$(git status --porcelain --untracked-files=normal)"
+export PARSA_RELEASE_SHA="$expected"
+DOCKER_BUILDKIT=0 docker compose -f /opt/services/parsa/frontend/compose.yml -f ops/frontend.compose.yml build frontend
+docker compose -f /opt/services/parsa/frontend/compose.yml -f ops/frontend.compose.yml up -d --no-deps --no-build frontend
+for i in {1..40}; do
+ if [ "$(curl --max-time 15 -fsS https://parsaaghayi.ir/api/revision || true)" = "$expected" ]; then
+ echo "Frontend verified revision: $expected"; exit 0
+ fi
+ sleep 3
+done
+exit 1
diff --git a/ops/frontend.compose.yml b/ops/frontend.compose.yml
new file mode 100644
index 0000000..8290d33
--- /dev/null
+++ b/ops/frontend.compose.yml
@@ -0,0 +1,8 @@
+services:
+ frontend:
+ build:
+ dockerfile: /opt/services/parsa/frontend/repo/ops/Dockerfile
+ environment:
+ PARSA_RELEASE_SHA: ${PARSA_RELEASE_SHA:?required}
+ labels:
+ org.opencontainers.image.revision: ${PARSA_RELEASE_SHA:?required}
diff --git a/src/__tests__/activity.test.tsx b/src/__tests__/activity.test.tsx
new file mode 100644
index 0000000..72fc8d9
--- /dev/null
+++ b/src/__tests__/activity.test.tsx
@@ -0,0 +1,13 @@
+import { render, screen, fireEvent } from '@testing-library/react';
+import { describe, it, expect } from 'vitest';
+import ActivityGrid, { ActivityData } from '../app/(routes)/(website)/components/activity/activity-grid';
+const data: ActivityData = {
+ timezone: 'Asia/Tehran', from: '2025-11-19', to: '2026-11-18', updated_at: '2026-11-18T10:00:00+03:30',
+ days: Array.from({length:365}, (_, i) => ({ date: new Date(Date.UTC(2025,10,19+i)).toISOString().slice(0,10), count: i === 364 ? 3 : 0 })),
+ stats: {total:3, active_days:1, daily_average:0.01, longest_streak:1}, months:[{month:'2026-11',count:3}]
+};
+describe('Activity aggregate view (isolated fixtures)', () => {
+ it('shows honest unavailable without invented statistics', () => { render(
GITEA / {fa ? "فعالیت مهندسی" : "ENGINEERING ACTIVITY"}
+{fa ? "مشارکتهای عمومی و خصوصی؛ فقط تعداد روزانه، بدون نام یا محتوای مخزن. ۳۶۵ روز اخیر بر اساس زمان تهران. مشارکت با تعداد کامیت برابر نیست." : "Public and private contributions, shared only as daily counts. No repository names or content. Last 365 days in Tehran time; contributions are not commit counts."}
+ {!valid ?{fa ? "اطلاعات فعالیت اکنون در دسترس نیست. لطفاً بعداً صفحه را تازه کنید." : "Activity is unavailable right now. Please refresh later."}
: <> +{selected ? dayLabel(data.days.find(d => d.date === selected)!) : fa ? "برای جزئیات، یک روز را انتخاب کنید. برای دیدن تمام سال به کنارهها پیمایش کنید." : "Select a day for details. Scroll sideways to explore the full year."}
+{date(data.from)} — {date(data.to)} · {fa ? "آخرین دریافت:" : "Fetched:"} {new Intl.DateTimeFormat(fa ? "fa-IR" : "en-GB", { dateStyle: "medium", timeStyle: "short", timeZone: "Asia/Tehran" }).format(new Date(data.updated_at))} · {fa ? "زمان تهران · تازهسازی تا ۵ دقیقه" : "Tehran time · refreshes within 5 minutes"}
+ >} +