Files
nfoguard/.gitea/workflows/ci.yml
T
2025-09-09 14:52:08 -04:00

67 lines
1.4 KiB
YAML

name: CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: host
steps:
- name: Checkout code
run: |
echo "Code already available in workspace"
pwd
ls -la
- name: Check Node.js version
run: |
which node || echo "Node.js not found in PATH"
node --version || echo "Node.js not available"
which npm || echo "npm not found in PATH"
npm --version || echo "npm not available"
- name: Install backend dependencies
run: |
cd backend
npm ci
- name: Run backend tests
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/nfoguard_test
JWT_SECRET: test-secret-key-for-ci
NODE_ENV: test
run: |
cd backend
npm run test
- name: Install frontend dependencies
run: |
cd frontend
npm ci
- name: Run frontend tests
run: |
cd frontend
npm run test
- name: Build frontend
run: |
cd frontend
npm run build
deploy:
needs: test
runs-on: host
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy application
run: |
echo "Deploying to production..."
echo "Current directory: $(pwd)"
echo "Available files:"
ls -la