Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathieusoysal/jib-container-publish.yml
GitHub Actions for your Java project to build container with jib and publish it to GitHub Packages.
https://github.com/mathieusoysal/jib-container-publish.yml
actions docker github-actions hacktoberfest java java-to-github-packages jib maven
Last synced: 8 days ago
JSON representation
GitHub Actions for your Java project to build container with jib and publish it to GitHub Packages.
- Host: GitHub
- URL: https://github.com/mathieusoysal/jib-container-publish.yml
- Owner: MathieuSoysal
- License: gpl-3.0
- Created: 2021-12-07T18:05:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T00:19:51.000Z (7 months ago)
- Last Synced: 2024-10-15T07:02:54.379Z (22 days ago)
- Topics: actions, docker, github-actions, hacktoberfest, java, java-to-github-packages, jib, maven
- Homepage:
- Size: 66.4 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Build container with JIB and publish it to GitHub Packages
GitHub action to build container with jib and publish it to GitHub Packages.
## Requirements
- Your project need to use Maven
## Usage
The workflow, usually declared in `.github/workflows/jib-publish.yml`, looks like:
```YAML
name: JIB container publishon:
release:
types: [created]jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: JIB container build and publish
uses: MathieuSoysal/[email protected]
with:
PASSWORD: ${{ secrets.GITHUB_TOKEN }}```
### You need to choice a registry other than GitHub Package ?
You can change the `REGISTRY`,`USERNAME`,`PASSWORD` to publish in the registry of your choice:
```YAML
name: JIB container publishon:
release:
types: [created]jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: JIB container build and publish
uses: MathieuSoysal/[email protected]
with:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as /
IMAGE_NAME: ${{ github.repository }}
# Tag name of the image to publish
tag-name: ${{ github.event.release.tag_name }}
# Username to login to registry
USERNAME: ${{ github.actor }}
# Password to login to registry
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
java-version: 17
```### Multi-Module Maven Projects
If you have a multi-module Maven project you can specify the main module containing the main class using the parameter
`module` and the main class using the parameter `main-class`.## License
The Dockerfile and associated scripts and documentation in this project are released under the [GPL-3.0 License](https://github.com/MathieuSoysal/jib-container-publish.yml/blob/main/LICENSE).