Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a58e0c731 | ||
|
|
1cbd210be1 | ||
|
|
8f8f0c36d5 | ||
|
|
ed20f6d089 |
No files matched your search
@@ -13,6 +13,7 @@ jobs:
|
|||||||
- name: Run deploy.sh from within the scripts folder
|
- name: Run deploy.sh from within the scripts folder
|
||||||
env:
|
env:
|
||||||
BRANCH: ${{ github.ref_name }}
|
BRANCH: ${{ github.ref_name }}
|
||||||
|
SUPPORT_CHAT_KEY: ${{ secrets.SUPPORT_CHAT_KEY }}
|
||||||
run: |
|
run: |
|
||||||
# 1. رفع مشکل DNS و غیرفعال کردن پروکسی برای دامنه محلی
|
# 1. رفع مشکل DNS و غیرفعال کردن پروکسی برای دامنه محلی
|
||||||
echo "87.248.133.138 git.parsaaghayi.ir" >> /etc/hosts
|
echo "87.248.133.138 git.parsaaghayi.ir" >> /etc/hosts
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
name: E2E Playwright Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- develop
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-e2e:
|
|
||||||
name: Run Full E2E & Security Suites
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install Monorepo Dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
run: npx playwright install --with-deps chromium
|
|
||||||
|
|
||||||
- name: Run E2E Test Suite
|
|
||||||
run: npx playwright test --project=chromium-desktop --project=admin-chromium
|
|
||||||
env:
|
|
||||||
CI: true
|
|
||||||
NODE_ENV: test
|
|
||||||
|
|
||||||
- name: Upload Test Report
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: playwright-report
|
|
||||||
path: playwright-report/
|
|
||||||
retention-days: 14
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
name: Torob regression
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [develop, main]
|
|
||||||
pull_request:
|
|
||||||
branches: [develop, main]
|
|
||||||
jobs:
|
|
||||||
torob-regression:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
torob-test-db:
|
|
||||||
image: postgres:16-alpine
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: torob
|
|
||||||
POSTGRES_PASSWORD: disposable-fixture-only
|
|
||||||
POSTGRES_DB: torob_test
|
|
||||||
options: >-
|
|
||||||
--health-cmd "pg_isready -U torob -d torob_test"
|
|
||||||
--health-interval 5s
|
|
||||||
--health-timeout 5s
|
|
||||||
--health-retries 10
|
|
||||||
container: node:20
|
|
||||||
env:
|
|
||||||
DATABASE_URL: postgresql://torob:disposable-fixture-only@torob-test-db:5432/torob_test
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install and generate isolated client
|
|
||||||
run: cd backend && npm ci && npx prisma generate
|
|
||||||
- name: Unit regressions
|
|
||||||
run: cd backend && npm test -- --runInBand src/products/torob.controller.spec.ts
|
|
||||||
- name: Disposable PostgreSQL integration
|
|
||||||
run: cd backend && npx prisma db push --skip-generate && npx jest --config test/jest-torob.json --runInBand
|
|
||||||
@@ -27,6 +27,11 @@ services:
|
|||||||
NPM_REGISTRY: ${NPM_REGISTRY:-}
|
NPM_REGISTRY: ${NPM_REGISTRY:-}
|
||||||
container_name: canino_backend_prod
|
container_name: canino_backend_prod
|
||||||
restart: always
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- path: .support-chat.env
|
||||||
|
required: false
|
||||||
|
- path: .revalidation.env
|
||||||
|
required: false
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- ENABLE_SWAGGER=false
|
- ENABLE_SWAGGER=false
|
||||||
@@ -59,6 +64,9 @@ services:
|
|||||||
VITE_API_URL: "https://api.canina.ir"
|
VITE_API_URL: "https://api.canina.ir"
|
||||||
container_name: canino_frontend_prod
|
container_name: canino_frontend_prod
|
||||||
restart: always
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- path: .revalidation.env
|
||||||
|
required: false
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.canina-prod.rule=Host(`canina.ir`) || Host(`www.canina.ir`) || Host(`admin.canina.ir`)"
|
- "traefik.http.routers.canina-prod.rule=Host(`canina.ir`) || Host(`www.canina.ir`) || Host(`admin.canina.ir`)"
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- path: .support-chat.env
|
- path: .support-chat.env
|
||||||
required: false
|
required: false
|
||||||
|
- path: .revalidation.env
|
||||||
|
required: false
|
||||||
dns:
|
dns:
|
||||||
- 217.218.127.127
|
- 217.218.127.127
|
||||||
- 217.218.155.155
|
- 217.218.155.155
|
||||||
@@ -67,6 +69,9 @@ services:
|
|||||||
VITE_API_URL: "https://stageapi.canina.ir"
|
VITE_API_URL: "https://stageapi.canina.ir"
|
||||||
container_name: canino_frontend_stage
|
container_name: canino_frontend_stage
|
||||||
restart: always
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- path: .revalidation.env
|
||||||
|
required: false
|
||||||
dns:
|
dns:
|
||||||
- 217.218.127.127
|
- 217.218.127.127
|
||||||
- 217.218.155.155
|
- 217.218.155.155
|
||||||
|
|||||||
@@ -66,6 +66,19 @@ fi
|
|||||||
|
|
||||||
cd "$TARGET_DIR"
|
cd "$TARGET_DIR"
|
||||||
|
|
||||||
|
# Inject support-chat runtime configuration from CI/CD without committing secrets.
|
||||||
|
if [ "${SUPPORT_CHAT_KEY+x}" = x ]; then
|
||||||
|
touch .support-chat.env
|
||||||
|
grep -v '^SUPPORT_CHAT_KEY=' .support-chat.env > .support-chat.env.tmp || true
|
||||||
|
printf "SUPPORT_CHAT_KEY=%s\n" "$SUPPORT_CHAT_KEY" >> .support-chat.env.tmp
|
||||||
|
mv .support-chat.env.tmp .support-chat.env
|
||||||
|
chmod 600 .support-chat.env
|
||||||
|
fi
|
||||||
|
if [ ! -s .support-chat.env ]; then
|
||||||
|
echo "ERROR: missing .support-chat.env / SUPPORT_CHAT_KEY; refusing deployment" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# ✅ فایلهای کانفیگ را از پوشهی scripts مخزن به TARGET_DIR کپی میکنیم
|
# ✅ فایلهای کانفیگ را از پوشهی scripts مخزن به TARGET_DIR کپی میکنیم
|
||||||
echo "Copying configuration files in $TARGET_DIR..."
|
echo "Copying configuration files in $TARGET_DIR..."
|
||||||
cp "scripts/$COMPOSE_FILE" "docker-compose.yml"
|
cp "scripts/$COMPOSE_FILE" "docker-compose.yml"
|
||||||
|
|||||||
Reference in new issue
Block a user