50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
name: CI/CD Pipeline
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install PWA Dependencies
|
|
run: |
|
|
npm install
|
|
npm run type-check
|
|
npm run lint
|
|
|
|
- name: Build PWA
|
|
run: npm run build
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Backend Dependencies
|
|
run: |
|
|
pip install fastapi uvicorn pydantic
|
|
|
|
- name: Test Backend
|
|
run: |
|
|
# Add your test command here, e.g., pytest
|
|
echo "Running backend tests..."
|
|
|
|
deploy:
|
|
needs: build-and-test
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Deploy to Coolify
|
|
run: |
|
|
curl -X POST "${{ secrets.COOLIFY_WEBHOOK_URL }}"
|