-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (54 loc) · 1.55 KB
/
workflow.yml
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
name: Continuous Delivery
on:
push:
branches:
- skeleton-angular
- 'issue/skeleton-angular/**'
workflow_dispatch:
env:
NODE_VERSION: 20.9.0
jobs:
install:
name: 'Installing NPM modules'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Caching NPM modules if necessary'
uses: actions/cache@v3
id: node-modules-cache
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
build-apps:
name: 'Building Apps'
needs: install
runs-on: ubuntu-latest
strategy:
matrix:
app:
- name: host-app
cmd: npm run host-app:build
- name: products-app
cmd: npm run products-app:build
- name: customers-app
cmd: npm run customers-app:build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: ${{ matrix.app.cmd }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.app.name }}
path: dist/${{ matrix.app.name }}