-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.92 KB
/
Copy pathci-frontend.yml
File metadata and controls
62 lines (52 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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