diff --git a/actions/java-gradle-build-push-jib/README.md b/actions/java-gradle-build-push-jib/README.md new file mode 100644 index 000000000..26c97b586 --- /dev/null +++ b/actions/java-gradle-build-push-jib/README.md @@ -0,0 +1,4 @@ +# jib-uploader + +- [Description](https://github.com/bakdata/ci-templates/tree/main/docs/descriptions/actions/java-gradle-build-push-jib) +- [References](https://github.com/bakdata/ci-templates/tree/main/docs/references/actions/java-gradle-build-push-jib) diff --git a/actions/java-gradle-build-push-jib/action.yaml b/actions/java-gradle-build-push-jib/action.yaml new file mode 100644 index 000000000..f699a5d02 --- /dev/null +++ b/actions/java-gradle-build-push-jib/action.yaml @@ -0,0 +1,29 @@ +name: "Build and upload Jib " +description: "Build the Jib image and upload it to the image repository" + +inputs: + image: + description: "The image name with its repository name" + required: true + tags: + description: "The tags to use to release the image" + required: true + class: + description: "The entrypoint class to be used for the image" + required: true + working-directory: + description: "Working directory to run the commands" + required: true + +runs: + using: "composite" + steps: + - name: Build & push Docker image + run: | + ./gradlew jib \ + --info --stacktrace \ + --image=${{ inputs.image }} \ + -Djib.container.mainClass=${{ inputs.class }} \ + -Djib.to.tags=${{ inputs.tags }} + shell: bash + working-directory: ${{ inputs.working-directory }} diff --git a/docs/actions/java-gradle-build-push-jib/README.md b/docs/actions/java-gradle-build-push-jib/README.md new file mode 100644 index 000000000..20a02592a --- /dev/null +++ b/docs/actions/java-gradle-build-push-jib/README.md @@ -0,0 +1,40 @@ +# Description java-gradle-build-push-jib composite action + +This composite action utilizes Jib to efficiently build a container image and automatically upload it to the referenced container repository. + +## Usage + +```yaml +- name: Build SentenceProducer image for tag release + uses: bakdata/ci-templates/actions/jib-uploader@main + with: + image: my-docker-registry/my-docker-image + class: org.example.MyClass + tags: latest,${GITHUB_REF/refs\/tags\//} + working-directory: "./" +``` + +## References + +### Inputs + + + +| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | +| ----------------- | ------ | -------- | ------- | --------------------------------------------- | +| class | string | true | | The entrypoint class to be used for the image | +| image | string | true | | The image name with its repository name | +| tags | string | true | | The tags to use to release the image | +| working-directory | string | true | | Working directory to run the commands | + + + +### Outputs + + + +No outputs. + + + +### Secrets