-
Notifications
You must be signed in to change notification settings - Fork 88
50 lines (41 loc) · 1.16 KB
/
Copy pathangular-build.yml
File metadata and controls
50 lines (41 loc) · 1.16 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
name: Angular CI
# Trigger manually from the Actions tab
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
# Step 3: Cache node_modules for faster builds
- name: Cache Node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Step 4: Install dependencies
- name: Install Dependencies
run: npm ci
# Step 5: Run unit tests
- name: Run Unit Tests
run: npm test -- --watch=false --browsers=ChromeHeadless
# Step 6: Build Angular project
- name: Build Angular Project
run: |
export NODE_OPTIONS=--openssl-legacy-provider
npm run build -- --prod
# Step 7: Upload build artifacts
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: angular-dist
path: dist/**