-
-
Notifications
You must be signed in to change notification settings - Fork 322
39 lines (37 loc) · 1.04 KB
/
build.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
name: Build
on:
workflow_call:
outputs:
cache-key:
value: ${{ jobs.build.outputs.cache-key }}
jobs:
build:
concurrency: build-${{ github.ref }}
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.value }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- run: npm clean-install
- id: cache-key
run: echo "value=dist-${{ hashFiles('src/**/*.ts', 'tsconfig/*.json', '.github/workflows/*.yml', 'package-lock.json') }}" >> $GITHUB_OUTPUT
- name: Cache dist
uses: actions/cache@v4
id: dist
with:
path: dist
key: ${{ steps.cache-key.outputs.value }}
- name: Build
run: npm run build-all
if: ${{ steps.dist.outputs.cache-hit != 'true' }}
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- run: git reset HEAD --hard