chore: update Docker Compose configuration for CMS development #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'scripts/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'pnpm-lock.yaml' | |
| - 'tsconfig*.json' | |
| - 'vite.config.*' | |
| - 'vitest.config.*' | |
| - 'playwright.config.*' | |
| - 'tailwind.config.*' | |
| - 'next.config.*' | |
| - 'docker-compose*.yml' | |
| - 'Dockerfile*' | |
| - '.github/workflows/**' | |
| pull_request: | |
| branches: [main, develop] | |
| paths: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'scripts/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'pnpm-lock.yaml' | |
| - 'tsconfig*.json' | |
| - 'vite.config.*' | |
| - 'vitest.config.*' | |
| - 'playwright.config.*' | |
| - 'tailwind.config.*' | |
| - 'next.config.*' | |
| - 'docker-compose*.yml' | |
| - 'Dockerfile*' | |
| - '.github/workflows/**' | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: overland_test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Type check | |
| run: pnpm typecheck | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Format check | |
| run: pnpm format:check | |
| - name: Build | |
| run: pnpm build | |
| env: | |
| DATABASE_URI: postgresql://postgres:postgres@localhost:5432/overland_test | |
| PAYLOAD_SECRET: test-secret-key-for-ci | |
| PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 | |
| PAYLOAD_PUBLIC_CMS_URL: http://localhost:3001/admin | |
| - name: Run unit tests | |
| run: pnpm test:unit | |
| env: | |
| DATABASE_URI: postgresql://postgres:postgres@localhost:5432/overland_test | |
| PAYLOAD_SECRET: test-secret-key-for-ci | |
| PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 | |
| PAYLOAD_PUBLIC_CMS_URL: http://localhost:3001/admin | |
| e2e: | |
| name: E2E Tests | |
| runs-on: ubuntu-latest | |
| needs: test | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: overland_test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright Browsers | |
| run: | | |
| pnpm --filter cms exec playwright install --with-deps | |
| pnpm --filter web exec playwright install --with-deps | |
| - name: Build applications | |
| run: pnpm build | |
| env: | |
| DATABASE_URI: postgresql://postgres:postgres@localhost:5432/overland_test | |
| PAYLOAD_SECRET: test-secret-key-for-ci | |
| PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 | |
| PAYLOAD_PUBLIC_CMS_URL: http://localhost:3001/admin | |
| - name: Run E2E tests | |
| run: pnpm test:e2e | |
| env: | |
| DATABASE_URI: postgresql://postgres:postgres@localhost:5432/overland_test | |
| PAYLOAD_SECRET: test-secret-key-for-ci | |
| PAYLOAD_PUBLIC_SERVER_URL: http://localhost:3001 | |
| PAYLOAD_PUBLIC_CMS_URL: http://localhost:3001/admin | |
| - name: Collect Playwright Reports | |
| if: always() | |
| run: | | |
| mkdir -p playwright-report | |
| # Copy web app report if it exists | |
| if [ -d "apps/web/playwright-report" ]; then | |
| cp -r apps/web/playwright-report/* playwright-report/ 2>/dev/null || true | |
| fi | |
| # Copy CMS report if it exists | |
| if [ -d "apps/cms/playwright-report" ]; then | |
| cp -r apps/cms/playwright-report/* playwright-report/ 2>/dev/null || true | |
| fi | |
| # Create a simple index if no reports were found | |
| if [ ! -d "playwright-report" ] || [ -z "$(ls -A playwright-report 2>/dev/null)" ]; then | |
| echo "No Playwright reports found" > playwright-report/index.html | |
| fi | |
| - name: Upload Playwright Report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |