Github actions: frontend build
Browse files
.github/workflows/frontend-build.yml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Frontend Build
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [ main ]
|
| 6 |
+
paths:
|
| 7 |
+
- 'frontend/**'
|
| 8 |
+
pull_request:
|
| 9 |
+
branches: [ main ]
|
| 10 |
+
paths:
|
| 11 |
+
- 'frontend/**'
|
| 12 |
+
|
| 13 |
+
jobs:
|
| 14 |
+
build:
|
| 15 |
+
runs-on: ubuntu-latest
|
| 16 |
+
|
| 17 |
+
steps:
|
| 18 |
+
- uses: actions/checkout@v4
|
| 19 |
+
|
| 20 |
+
- name: Set up Node.js
|
| 21 |
+
uses: actions/setup-node@v4
|
| 22 |
+
with:
|
| 23 |
+
node-version: '22'
|
| 24 |
+
cache: 'npm'
|
| 25 |
+
cache-dependency-path: frontend/package-lock.json
|
| 26 |
+
|
| 27 |
+
- name: Install dependencies
|
| 28 |
+
run: npm ci
|
| 29 |
+
working-directory: ./frontend
|
| 30 |
+
|
| 31 |
+
- name: Build frontend
|
| 32 |
+
run: npm run build
|
| 33 |
+
working-directory: ./frontend
|
| 34 |
+
env:
|
| 35 |
+
NODE_ENV: production
|
| 36 |
+
|
| 37 |
+
- name: Archive production artifacts
|
| 38 |
+
uses: actions/upload-artifact@v4
|
| 39 |
+
with:
|
| 40 |
+
name: frontend-build
|
| 41 |
+
path: frontend/public
|
| 42 |
+
retention-days: 5
|