Make it easier to run workflows locally with 'act'

This commit is contained in:
daz 2024-04-11 11:56:01 -06:00
parent ea328a863d
commit 33741bd2bb
No known key found for this signature in database
2 changed files with 19 additions and 5 deletions

View file

@ -11,6 +11,7 @@ runs:
# Downloads a 'dist' directory artifact that was uploaded in an earlier 'build-dist' step
- name: Download dist
if: ${{ !env.ACT }}
uses: actions/download-artifact@v4
with:
name: dist

23
build
View file

@ -3,8 +3,21 @@
cd sources
npm install
if [ "$1" == "all" ]; then
npm run all
else
npm run build
fi
case "$1" in
all)
nprm run all
;;
act)
# Build and copy outputs to the dist directory
npm run build
cd ..
cp -r sources/dist .
# Run act
$@
# Revert the changes to the dist directory
git co -- dist
;;
*)
npm run build
;;
esac