Curious if this is a common workflow. I’ll describe my current stack and reason for wanting this, since it seems like the type of thing I shouldn’t be the first to run into.
I was building a web app + desktop app with ReactJS / ElectronJS, and there was nice separation between source code and build artifacts. I edit source code, then commit,
build/ directory is gitignored, and we have a workflow on GitHub Actions which automatically runs some build steps and creates a Release.
However, the new thing is we added Capacitor, for creating mobile apps, and the way Capacitor works is it takes what’s in
build/ and generates/modifies your
android/ folders, which contain fully ready-to-be-run mobile apps. The problem is that from that viewpoint,
android/ are build artifacts, but since developers are also allowed to (and expected to) modify code in
android/ manually, those directories are expected to be checked into version control. So now a developer must remember to
npm run build and copy it into
npx cap sync) before any commit, or the raw source code and the built code will be “out of sync”.
So I’m wondering if there could be a GitHub Action which handles doing this build + sync, where if it finds that the build + sync changes any files in
android/ (meaning developers didn’t build + sync before committing) then this Action would create an additional commit with the result of build + sync.
- Does that seem like the supported method of dealing with a tool like Capacitor that operates that way?
- Can this be done with GitHub Actions in a reasonable manner?