Compare commits

...

16 Commits

Author SHA1 Message Date
parsa aghaei
f949b99705 fix(ci): update workflow image to node:20-alpine
Some checks failed
Deploy Canina / deploy (push) Failing after 2s
2026-08-01 16:40:31 +03:30
parsa aghaei
5e08c8d23e chore: sync develop to main for CI/CD production release
Some checks failed
Deploy Canina / deploy (push) Failing after 15s
2026-08-01 16:29:39 +03:30
parsa aghaei
8b1c8d4053 feat: sync mobile UI, searchable selects, zip code, trust-seals header fix to main 2026-08-01 12:41:55 +03:30
parsa aghaei
b96379b88b fix(build): sync PRODUCTS import fix to main
All checks were successful
Deploy Canina / deploy (push) Successful in 2m22s
2026-08-01 11:39:39 +03:30
parsa aghaei
c9a9a18c83 feat(checkout): sync checkout payment & address UI polish to main
Some checks failed
Deploy Canina / deploy (push) Failing after 42s
2026-08-01 11:38:45 +03:30
parsa aghaei
d85e2f1d32 fix(build): sync Dockerfile vite build fix to main
Some checks failed
Deploy Canina / deploy (push) Failing after 4m47s
2026-08-01 11:23:11 +03:30
parsa aghaei
d5507d432d feat(payment): sync eNamad & card-to-card payment methods to main
All checks were successful
Deploy Canina / deploy (push) Successful in 2m19s
2026-08-01 11:15:43 +03:30
parsa aghaei
95e488baaa fix(lint): sync clean types and imports to main
All checks were successful
Deploy Canina / deploy (push) Successful in 1m54s
2026-07-29 16:45:13 +03:30
parsa aghaei
f0329d8b5b fix(admin): sync product update & image URL features to main
Some checks failed
Deploy Canina / deploy (push) Failing after 1m1s
2026-07-29 16:42:30 +03:30
parsa aghaei
893280dc2c fix(deploy): sync force-recreate fix to main
All checks were successful
Deploy Canina / deploy (push) Successful in 46s
2026-07-29 16:16:02 +03:30
parsa aghaei
a8dd6efddb fix(deploy): sync deploy.sh container conflict fix to main
Some checks failed
Deploy Canina / deploy (push) Failing after 12s
2026-07-29 16:08:08 +03:30
parsa aghaei
a767e9a6b8 merge: sync develop fixes into main
Some checks failed
Deploy Canina / deploy (push) Failing after 9m25s
2026-07-29 15:55:50 +03:30
devops
476d7759f4 chore: update to canina.ir domains, remove parsaaghayi.ir
Some checks failed
Deploy Canina / deploy (push) Failing after 11s
2026-07-28 06:37:02 +00:00
devops
2bbe244ab6 test: trigger CI/CD
Some checks failed
Deploy Canina / deploy (push) Failing after 17s
2026-07-27 16:12:16 +00:00
devops
a4620ad310 test: trigger CI/CD
Some checks failed
Deploy Canina / deploy (push) Failing after 10s
2026-07-27 16:09:20 +00:00
devops
41d7629d2a fix: VPN build, caching, Dockerfile fixes for Iran network
Some checks failed
Deploy Canina / deploy (push) Failing after 12s
2026-07-27 16:06:35 +00:00
6 changed files with 48 additions and 46 deletions

View File

@ -9,29 +9,24 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: canina runs-on: canina
container: timeout-minutes: 20
image: node:20-alpine
timeout-minutes: 40
steps: steps:
- name: Setup SSH key - name: Setup SSH key
shell: sh shell: sh
env: env:
SSH_KEY: ${{ secrets.DEPLOY_KEY }} SSH_KEY: ${{ secrets.DEPLOY_KEY }}
run: | run: |
apk add --no-cache openssh-client bash
mkdir -p ~/.ssh mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_ed25519 echo "$SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -p 2234 -H 172.17.0.1 >> ~/.ssh/known_hosts ssh-keyscan -p 2234 -H 172.17.0.1 >> ~/.ssh/known_hosts
- name: Deploy - name: Deploy with VPN for build
shell: sh shell: sh
timeout-minutes: 38 timeout-minutes: 20
env:
BRANCH: ${{ github.ref_name }}
run: | run: |
BRANCH="${GITHUB_REF_NAME}"
echo "Deploying branch: ${BRANCH}" echo "Deploying branch: ${BRANCH}"
ssh -o StrictHostKeyChecking=no \ ssh -o StrictHostKeyChecking=no -p 2234 devops@172.17.0.1 \
-o ServerAliveInterval=30 \ "bash /opt/services/scripts/with-vpn.sh \"bash /opt/services/canina/deploy.sh ${BRANCH}\""
-o ServerAliveCountMax=30 \
-p 2234 devops@172.17.0.1 \
"sudo bash /opt/services/scripts/depcanina.sh ${BRANCH}"

View File

@ -1,7 +1,7 @@
FROM node:20-alpine AS app-builder FROM node:20-alpine AS app-builder
WORKDIR /app WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
ENV NEXT_PUBLIC_API_URL=https://stageapi.canina.ir/api ENV NEXT_PUBLIC_API_URL=https://api.canina.ir/api
COPY frontend/application/package*.json ./ COPY frontend/application/package*.json ./
RUN npm ci --include=dev --prefer-offline --no-audit RUN npm ci --include=dev --prefer-offline --no-audit
COPY frontend/application ./ COPY frontend/application ./
@ -11,7 +11,7 @@ RUN npm run build
FROM node:20-alpine AS admin-builder FROM node:20-alpine AS admin-builder
WORKDIR /app WORKDIR /app
ENV VITE_API_URL=https://stageapi.canina.ir/api ENV VITE_API_URL=https://api.canina.ir/api
COPY frontend/admin-panel/package*.json ./ COPY frontend/admin-panel/package*.json ./
RUN npm ci --include=dev --prefer-offline --no-audit RUN npm ci --include=dev --prefer-offline --no-audit
COPY frontend/admin-panel ./ COPY frontend/admin-panel ./

View File

@ -131,3 +131,5 @@
**تهیه شده با رویکرد پزشکی و رعایت اصل تناسب و پاکیزگی دیزاین.** ❤️ **تهیه شده با رویکرد پزشکی و رعایت اصل تناسب و پاکیزگی دیزاین.** ❤️
**کیفیت ممتاز آلمانی، دسترسی آسان ایرانی.** **کیفیت ممتاز آلمانی، دسترسی آسان ایرانی.**
# CI/CD test
# CI/CD test

View File

@ -1,12 +1,14 @@
FROM node:20-alpine AS builder FROM node:20-alpine AS builder
RUN apk add --no-cache openssl 2>/dev/null || true
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm config set registry http://registry.parsaaghayi.ir/repository/npm-proxy/ && npm ci RUN npm ci --prefer-offline --no-audit
COPY . . COPY . .
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
RUN npx prisma generate && npm run build RUN npx prisma generate && npm run build
FROM node:20-alpine FROM node:20-alpine
RUN apk add --no-cache openssl 2>/dev/null || true
RUN mkdir -p /app/uploads && chown node:node /app/uploads RUN mkdir -p /app/uploads && chown node:node /app/uploads
WORKDIR /app WORKDIR /app
COPY --chown=node:node --from=builder /app/package*.json ./ COPY --chown=node:node --from=builder /app/package*.json ./

View File

@ -1,63 +1,65 @@
services: services:
db_stage: db_prod:
image: postgres:16-alpine image: postgres:16-alpine
container_name: canino_db_stage container_name: canino_db_prod
restart: always restart: always
environment: environment:
POSTGRES_USER: canino_stage POSTGRES_USER: canino_prod
POSTGRES_PASSWORD: caninopassword_stage POSTGRES_PASSWORD: caninopassword_prod
POSTGRES_DB: caninodb_stage POSTGRES_DB: caninodb_prod
volumes: volumes:
- canina_stage_db:/var/lib/postgresql/data - canina_prod_db:/var/lib/postgresql/data
networks: networks:
- traefik_public - traefik_public
redis_stage: redis_prod:
image: redis:7-alpine image: redis:7-alpine
container_name: canino_redis_stage container_name: canino_redis_prod
restart: always restart: always
networks: networks:
- traefik_public - traefik_public
backend_stage: backend_prod:
build: build:
context: ./backend context: ./backend
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: canino_backend_stage container_name: canino_backend_prod
restart: always restart: always
environment: environment:
- DATABASE_URL=postgresql://canino_stage:caninopassword_stage@db_stage:5432/caninodb_stage?schema=public - DATABASE_URL=postgresql://canino_prod:caninopassword_prod@db_prod:5432/caninodb_prod?schema=public
- REDIS_HOST=redis_stage - REDIS_HOST=redis_prod
- REDIS_PORT=6379 - REDIS_PORT=6379
- PORT=3000 - PORT=3000
volumes:
- canina_prod_uploads:/app/uploads
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.canina-api-stage.rule=Host(`stageapi.canina.ir`) || Host(`api.caninastage.parsaaghayi.ir`)" - "traefik.http.routers.canina-api-prod.rule=Host(`api.canina.ir`) || Host(`apicanina.parsaaghayi.ir`)"
- "traefik.http.routers.canina-api-stage.entrypoints=websecure" - "traefik.http.routers.canina-api-prod.entrypoints=websecure"
- "traefik.http.routers.canina-api-stage.tls=true" - "traefik.http.routers.canina-api-prod.tls=true"
- "traefik.http.services.canina-api-stage.loadbalancer.server.port=3000" - "traefik.http.services.canina-api-prod.loadbalancer.server.port=3000"
depends_on: depends_on:
- db_stage - db_prod
- redis_stage - redis_prod
networks: networks:
- traefik_public - traefik_public
frontend_stage: frontend_prod:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: canino_frontend_stage container_name: canino_frontend_prod
restart: always restart: always
environment: environment:
- NEXT_PUBLIC_API_URL=http://backend_stage:3000 - NEXT_PUBLIC_API_URL=http://backend_prod:3000
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.canina-stage.rule=Host(`stage.canina.ir`) || Host(`stageadmin.canina.ir`) || Host(`caninastage.parsaaghayi.ir`)" - "traefik.http.routers.canina-prod.rule=Host(`canina.ir`) || Host(`admin.canina.ir`) || Host(`canina.parsaaghayi.ir`) || Host(`admincanina.parsaaghayi.ir`)"
- "traefik.http.routers.canina-stage.entrypoints=websecure" - "traefik.http.routers.canina-prod.entrypoints=websecure"
- "traefik.http.routers.canina-stage.tls=true" - "traefik.http.routers.canina-prod.tls=true"
- "traefik.http.services.canina-stage.loadbalancer.server.port=8080" - "traefik.http.services.canina-prod.loadbalancer.server.port=8080"
depends_on: depends_on:
- backend_stage - backend_prod
networks: networks:
- traefik_public - traefik_public
@ -66,4 +68,5 @@ networks:
external: true external: true
volumes: volumes:
canina_stage_db: canina_prod_db:
canina_prod_uploads:

View File

@ -1,6 +1,6 @@
server { server {
listen 8080; listen 8080;
server_name __APP_HOST__; server_name canina.ir stage.canina.ir;
# Security Headers # Security Headers
server_tokens off; server_tokens off;
@ -21,7 +21,7 @@ server {
# Backend API # Backend API
location /api { location /api {
proxy_pass http://__BACKEND_HOST__:3000; proxy_pass http://backend:3000;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade'; proxy_set_header Connection 'upgrade';
@ -33,7 +33,7 @@ server {
server { server {
listen 8080; listen 8080;
server_name __ADMIN_HOST__; server_name admin.canina.ir stageadmin.canina.ir;
root /app/admin_static; root /app/admin_static;
index index.html; index index.html;
@ -52,7 +52,7 @@ server {
# Backend API for Admin # Backend API for Admin
location /api { location /api {
proxy_pass http://__BACKEND_HOST__:3000; proxy_pass http://backend:3000;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade'; proxy_set_header Connection 'upgrade';