Add CI pipeline for develop branch #1
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 - Develop | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1️⃣ Checkout code | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2️⃣ Set up Python for backend tests | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install backend dependencies | |
| working-directory: backend | |
| run: | | |
| pip install -r requirements.txt | |
| - name: Run backend tests | |
| working-directory: backend | |
| run: | | |
| pytest | |
| # 3️⃣ Set up Node.js for frontend | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install frontend dependencies | |
| working-directory: frontend | |
| run: | | |
| npm ci | |
| - name: Run frontend build check | |
| working-directory: frontend | |
| run: | | |
| npm run build | |
| # 4️⃣ Login to container registry (placeholder) | |
| - name: Login to Container Registry | |
| run: echo "Registry login will be added next" | |
| # 5️⃣ Build & tag Docker images using Git SHA | |
| - name: Build Docker images | |
| run: | | |
| SHORT_SHA=${GITHUB_SHA::7} | |
| docker build -t pgagi-backend:${SHORT_SHA} backend | |
| docker build -t pgagi-frontend:${SHORT_SHA} frontend | |
| # 6️⃣ Push images (placeholder) | |
| - name: Push Docker images | |
| run: echo "Docker push will be added once registry is configured" |