Feature/component library #14
Workflow file for this run
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 — Frontend | |
| # Triggers on pushes and PRs that touch the frontend directory. | |
| # Installs dependencies, builds Next.js (standalone output), and uploads a deployment artifact. | |
| # | |
| # Artifact produced: frontend-drop — consumed by cd-frontend.yml | |
| # | |
| # NOTE: next.config.ts must have output: 'standalone' for this workflow to produce a correct artifact. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ['frontend/**'] | |
| pull_request: | |
| branches: [main] | |
| paths: ['frontend/**'] | |
| env: | |
| NODE_VERSION: '20.x' | |
| jobs: | |
| build: | |
| name: Install, Build & Package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: frontend | |
| - name: Build Next.js | |
| run: npm run build | |
| working-directory: frontend | |
| env: | |
| # Placeholder values satisfy build-time env var requirements. | |
| # Actual values are injected at runtime via App Service app settings. | |
| NEXTAUTH_URL: 'http://placeholder' | |
| NEXTAUTH_SECRET: 'placeholder-build-secret-32-chars!!' | |
| KEYCLOAK_CLIENT_ID: placeholder | |
| KEYCLOAK_CLIENT_SECRET: placeholder | |
| KEYCLOAK_ISSUER: 'https://placeholder.example.com/realms/placeholder' | |
| NEXT_PUBLIC_API_BASE_URL: 'https://placeholder' | |
| # Next.js standalone output does not include public/ or .next/static/ automatically. | |
| - name: Copy public/ and static/ into standalone output | |
| run: | | |
| cp -r frontend/public frontend/.next/standalone/ | |
| cp -r frontend/.next/static frontend/.next/standalone/.next/static | |
| - name: Upload frontend-drop | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-drop | |
| path: frontend/.next/standalone |