Skip to content

Commit 0cc1b15

Browse files
committed
fix: improve build step error handling and update output directory
1 parent 2a4d1b6 commit 0cc1b15

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/build.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
- name: Install Packages
5050
run: |
5151
npm ci
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5254
# - name: Replace version number for api call
5355
# uses: jacobtomlinson/gha-find-replace@v3
5456
# with:
@@ -57,19 +59,18 @@ jobs:
5759
# include: 'appVersion.ts'
5860
- name: Build App
5961
run: |
60-
buildSummary=$(npm run build)
61-
62-
IFS=""
63-
readarray buildSummaryArray <<< "$buildSummary"
64-
65-
for i in ${buildSummaryArray[@]}
66-
do
67-
echo "$i" >> $GITHUB_STEP_SUMMARY
68-
done
62+
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
63+
if ! npm run build 2>&1 | tee build_output.txt; then
64+
echo "Build failed!" >> $GITHUB_STEP_SUMMARY
65+
cat build_output.txt >> $GITHUB_STEP_SUMMARY
66+
exit 1
67+
fi
68+
echo "" >> $GITHUB_STEP_SUMMARY
69+
cat build_output.txt >> $GITHUB_STEP_SUMMARY
6970
- name: Archive Output
7071
id: package
7172
run: |
72-
cd dist
73+
cd build
7374
branch=${GITHUB_REF#refs/heads/}
7475
7576
if [ '${{ inputs.newVersion }}' = 'true' ]; then

0 commit comments

Comments
 (0)