forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrontend-build.yml
More file actions
62 lines (51 loc) 路 1.44 KB
/
Copy pathfrontend-build.yml
File metadata and controls
62 lines (51 loc) 路 1.44 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: Frontend Build & Optimization
on:
push:
branches: [main, develop]
paths:
- 'Frontend/**'
pull_request:
branches: [main, develop]
paths:
- 'Frontend/**'
jobs:
build:
name: Build & Optimize Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: Frontend/package-lock.json
- name: Install dependencies
working-directory: Frontend
run: npm ci
- name: Run ESLint
working-directory: Frontend
run: npm run lint
- name: Run TypeScript checks
working-directory: Frontend
run: npx tsc --noEmit
- name: Build Next.js application
working-directory: Frontend
run: npm run build
env:
NODE_ENV: production
- name: Optimize assets
run: bash infrastructure/ci/scripts/optimize-assets.sh
- name: Generate source maps
working-directory: Frontend
run: |
if [ -d ".next" ]; then
find .next -name "*.map" | wc -l | xargs echo "Source maps generated:"
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-build-${{ github.sha }}
path: Frontend/.next/
retention-days: 7