-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9141855
commit f45c3af
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: check dist is up to date | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- 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 |