-
-
Notifications
You must be signed in to change notification settings - Fork 146
65 lines (55 loc) · 1.89 KB
/
service_install-and-build-node.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
55
56
57
58
59
60
61
62
63
64
65
on:
workflow_call:
env:
DOCKER_COMPOSE_CMD: docker compose -f docker-compose.yml -f docker-compose.ci.yml
jobs:
node-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Restore composer cache
uses: actions/cache/restore@v4
id: composer-cache-restore
with:
path: vendor/
fail-on-cache-miss: true
key: ${{ runner.os }}-composer-vendor-${{ hashFiles('composer.lock') }}
- name: Check composer cache
if: steps.composer-cache-restore.outputs.cache-hit != 'true'
run: exit 1
- name: Restore node_modules cache (if available)
id: node-modules-restore
uses: actions/cache/restore@v4
with:
path: node_modules/
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
- if: ${{ steps.node-modules-restore.outputs.cache-hit != 'true' }}
name: Run "yarn install"
run: |
$DOCKER_COMPOSE_CMD \
run \
node \
yarn install --frozen-lockfile
- name: Run "yarn build"
run: |
$DOCKER_COMPOSE_CMD \
run \
node \
yarn build
- if: ${{ steps.node-modules-restore.outputs.cache-hit != 'true' }}
name: Upload node_modules cache
uses: actions/cache/save@v4
with:
path: node_modules/
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
- if: ${{ steps.node-modules-restore.outputs.cache-hit != 'true' }}
name: Upload node_modules cache
uses: actions/cache/save@v4
with:
path: node_modules/
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
- name: Upload public/build cache
uses: actions/cache/save@v4
with:
path: public/build/
key: ${{ runner.os }}-public-build-${{ github.sha }}