-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 873 Bytes
/
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
40
41
42
name: build and compare dist
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: install dependencies
run: yarn install --frozen-lockfile
- name: rebuild
run: yarn build
- name: compare dist
run: |
if [ "$(git diff --ignore-space-at-eol ./dist | wc -l)" -gt "0" ]; then
echo "dist is not up to date"
git diff
exit 1
fi
id: diff
- name: upload artifact
if: ${{ steps.diff.outputs.exit_code == '1' }}
uses: actions/upload-artifact@v3
with:
name: dist
path: dist