Simple Maven application with container build.
my-maven-app/
├── src/
│ └── main/java/...
├── pom.xml
├── Containerfile
└── .github/
├── artifacts.yml
└── workflows/
└── release-workflow.yml
See artifacts.yml in this directory.
Key points:
- Single Maven artifact
- Publishes to GitHub Packages
- Builds multi-platform container
See release-workflow.yml in this directory.
-
Copy files to your repository:
mkdir -p .github/workflows cp examples/maven-app/artifacts.yml .github/ cp examples/maven-app/release-workflow.yml .github/workflows/
-
Customize for your project:
- Update
namein artifacts.yml - Adjust
java-versionif needed - Verify
Containerfilepath
- Update
-
Create first release:
git tag -s v1.0.0 -m "Release v1.0.0" git push origin v1.0.0
- Maven JAR artifact →
target/*.jar - Published to → GitHub Packages
- Container image →
ghcr.io/org/repo:v1.0.0 - Platforms →
linux/amd64,linux/arm64