Skip to content

Merge pull request #7 from Hermi-git/backend #23

Merge pull request #7 from Hermi-git/backend

Merge pull request #7 from Hermi-git/backend #23

Workflow file for this run

name: Frontend CI/CD

Check failure on line 1 in .github/workflows/frontend-ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/frontend-ci.yml

Invalid workflow file

(Line: 125, Col: 5): 'if' is already defined
# NOTE: Temporarily disabled - focusing on backend embedding features
# To re-enable, remove the 'if: false' condition below
on:
push:
branches: [main, develop]
paths:
- 'frontend/**'
- '.github/workflows/frontend-ci.yml'
pull_request:
branches: [main, develop]
paths:
- 'frontend/**'
jobs:
lint:
name: ESLint & Code Quality
if: false # Temporarily disabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- name: Install dependencies
run: |
cd frontend
npm ci
- name: Run ESLint
run: |
cd frontend
npm run lint
- name: Check TypeScript types
run: |
cd frontend
npx tsc --noEmit
test:
name: Unit Tests
if: false # Temporarily disabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- name: Install dependencies
run: |
cd frontend
npm ci
- name: Run tests
run: |
cd frontend
npm run test -- --coverage
env:
CI: true
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./frontend/coverage/coverage-final.json
flags: frontend-unit
name: frontend-coverage
build:
name: Build Next.js App
if: false # Temporarily disabled
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- name: Install dependencies
run: |
cd frontend
npm ci
- name: Build application
run: |
cd frontend
npm run build
- name: Export static files
run: |
cd frontend
npm run export
continue-on-error: true
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: nextjs-build
path: frontend/.next/
retention-days: 7
docker:
name: Build Docker Image
if: false # Temporarily disabled
runs-on: ubuntu-latest
needs: [lint, test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKER_USERNAME }}/mindvault-frontend
ghcr.io/${{ github.repository }}/frontend
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=branch
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: frontend
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max