Add onlyIf predicate to installFrontendDependencies and buildFrontend tasks
so they are skipped when SKIP_FRONTEND env var is present. This fixes the
Docker multi-stage build which failed because Gradle validated input files
(package.json, package-lock.json) that don't exist in the builder stage.
Also moved the skipFrontend variable definition before task registration
for cleaner code organization.
Co-authored-by: Junie <junie@jetbrains.com>