The qqq-frontend-material-dashboard project has been successfully integrated with the Kingsrook GitHub Actions Library to provide standardized CI/CD workflows for building, testing, and publishing.
This project is configured as an integrated Maven+NPM project where:
- Maven handles the overall build lifecycle and Java components
- The frontend-maven-plugin builds the React frontend and packages it into the Maven JAR
- NPM components are not published separately - they are embedded as resources in the Maven JAR
The project uses the following workflow configuration in .github/workflows/ci.yml:
name: 'CI/CD Pipeline'
on:
push:
branches: [ main, develop, 'release/*', 'hotfix/*', 'feature/*' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
publish:
name: '🚀 Build, Test, and Publish Release (main, rc, hotfix, or snapshot)'
if: |
github.ref_name == 'main' ||
github.ref_name == 'develop' ||
startsWith(github.ref_name, 'release/') ||
startsWith(github.ref_name, 'hotfix/')
uses: Kingsrook/github-actions-library/.github/workflows/reusable-gitflow-publish@develop
with:
project-type: 'maven'
java-version: '17'
maven-args: '-B -q -P ci package'
maven-working-directory: '.'
secrets:
GPG_PRIVATE_KEY_B64: ${{ secrets.GPG_PRIVATE_KEY_B64 }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
test:
name: '🧪 Build and Test Only'
if: |
!(
github.ref_name == 'main' ||
github.ref_name == 'develop' ||
startsWith(github.ref_name, 'release/') ||
startsWith(github.ref_name, 'hotfix/')
)
uses: Kingsrook/github-actions-library/.github/workflows/reusable-gitflow-test@develop
with:
project-type: 'maven'
java-version: '17'
maven-args: '-B -q -P ci package'
maven-working-directory: '.'- Project Type:
maven- This is correct for an integrated project where Maven builds everything - Maven Arguments:
-B -q -P ci package- Uses the CI profile and runs the package phase to trigger frontend build - Branch Reference:
@develop- Uses the latest version of the GitHub Actions library - Java Version:
17- Matches the project's Java version requirement
The project includes a CI profile in pom.xml that optimizes the build for automated environments:
<profile>
<!-- CI/CD profile - optimized for automated builds -->
<id>ci</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<nodeVersion>v18.17.0</nodeVersion>
<npmVersion>9.6.7</npmVersion>
<workingDirectory>.</workingDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>The main build configuration includes the frontend-maven-plugin with the following executions:
- install-node-and-npm: Installs Node.js v18.17.0 and NPM 9.6.7
- npm-install: Runs
npm install --legacy-peer-depsto handle peer dependency conflicts - npm-build: Runs
npm run buildto create the production React build - copy-frontend-build: Copies the built frontend files to Maven resources
To test the build locally:
# Set up Java 17
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
# Run the same command as the CI workflow
mvn clean compile test-compile -B -P ci package- Environment Validation: Validates required secrets and configurations
- Version Management: Uses calculate-version.sh to determine next version
- Build and Test:
- Installs Node.js and NPM
- Runs
npm install --legacy-peer-deps - Runs
npm run buildto create production build - Copies frontend files to Maven resources
- Compiles Java code
- Runs tests
- Publishing: Publishes to Maven Central (for publishing branches)
- Git Operations: Commits version changes (for publishing branches)
The following secrets must be configured in the GitHub repository:
GPG_PRIVATE_KEY_B64- Base64 encoded GPG private key for artifact signingGPG_KEYNAME- GPG key identifier (email or key ID)GPG_PASSPHRASE- GPG key passphraseCENTRAL_USERNAME- Sonatype OSSRH username for Maven CentralCENTRAL_PASSWORD- Sonatype OSSRH password for Maven CentralNPM_TOKEN- NPM authentication token (required even though NPM isn't published separately)
- No additional secrets required beyond the standard
GITHUB_TOKEN
The workflow follows GitFlow conventions:
- Feature branches (
feature/*): Run test workflow only - Develop branch (
develop): Run publish workflow, creates SNAPSHOT versions - Release branches (
release/*): Run publish workflow, creates RC versions - Main branch (
main): Run publish workflow, creates stable releases - Hotfix branches (
hotfix/*): Run publish workflow, creates patch versions
The workflow uses the calculate-version.sh script from the GitHub Actions library to:
- Determine the current version from
pom.xml - Calculate the next version based on branch type
- Update version files automatically
- Handle SNAPSHOT, RC, and stable version formats
- Frontend Build Failures: Ensure the CI profile is properly configured and Node.js/NPM versions match
- Peer Dependency Conflicts: The workflow uses
--legacy-peer-depsto handle React 18 + Material-UI conflicts - Version Calculation Errors: Check that the
calculate-version.shscript is accessible and the branch naming follows GitFlow conventions
To debug build issues locally:
# Run with verbose output
mvn clean compile test-compile -B -P ci package -X
# Check Node.js and NPM versions
node --version
npm --version
# Test frontend build separately
npm install --legacy-peer-deps
npm run build✅ Completed:
- Workflow configuration updated to use develop branch
- Maven arguments configured for integrated build
- CI profile properly configured
- Local testing confirmed working
- Documentation created
🔄 Next Steps:
- Push changes to trigger GitHub Actions workflow
- Monitor workflow execution and fix any issues
- Test publishing workflow on appropriate branches