mitlist/.gitea/workflows/build-test.yml
mohamad cb51186830 feat: Add production deployment configuration and environment setup
- Introduced `docker-compose.prod.yml` to define services for production deployment, including PostgreSQL, FastAPI backend, frontend, and Redis.
- Created `env.production.template` to outline necessary environment variables for production, ensuring sensitive data is not committed.
- Added `PRODUCTION.md` as a deployment guide detailing the setup process using Docker Compose and Gitea Actions for CI/CD.
- Implemented Gitea workflows for build, test, and deployment processes to streamline production updates.
- Updated backend and frontend Dockerfiles for optimized production builds and configurations.
- Enhanced application settings to support environment-specific configurations, including CORS and health checks.
2025-05-28 08:23:22 +02:00

71 lines
1.7 KiB
YAML

name: Build and Test
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '24'
- name: Install backend dependencies
working-directory: ./be
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Install frontend dependencies
working-directory: ./fe
run: npm ci
- name: Run backend tests
working-directory: ./be
env:
DATABASE_URL: postgresql+asyncpg://testuser:testpassword@localhost:5432/testdb
SECRET_KEY: testsecretkey
GEMINI_API_KEY: testgeminikey # Mock or skip tests requiring this if not available
SESSION_SECRET_KEY: testsessionsecret
run: pytest
- name: Build frontend
working-directory: ./fe
run: npm run build
# Add frontend test command if you have one e.g. npm test
# - name: Run frontend tests
# working-directory: ./fe
# run: npm test