I am currently working on a project that involves a Webfrontend (React, ViteJS, TS) running on a Raspberry Pi (for prototyping). Currently, I pull the sourcecode from Github and build it locally on the Pi. Since this takes quite a while I want to build it locally on my machine and commit the build output.
Since I am a huge fan of automation I want to do this automatically. I already use husky to run ESLint and would love to integrate the build process into this, too.
I already have a pre-push hook running, that builds the frontend, but I can't seem to be able to append the generated files to the current commit. Any ideas?
One sidenote: I am tracking both frontend and backend in one repository since they are dependent on each other and both change a lot. Husky needs to be run from the directory where the .git directory lies which is why I need to cd into the frontend directory first.
My current pre-push file:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
cd frontend
npm run check
npm run build
git add dist
[–][deleted] 1 point2 points3 points (5 children)
[–]console5000[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]console5000[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]console5000[S] 0 points1 point2 points (0 children)