Bump com.diffplug.spotless:spotless-maven-plugin from 2.44.3 to 2.44.4 #298
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Build | |
on: | |
# Build container according to ref input: | |
workflow_call: | |
inputs: | |
ref: | |
description: "The branch, tag or SHA to checkout" | |
required: true | |
type: string | |
container-image-name: | |
description: "Name for the container image to build" | |
required: false | |
type: string | |
container-image-type: | |
description: "Type of the container image to build, e.g. Backend or Distribution" | |
required: false | |
type: string | |
secrets: | |
github-token: | |
description: "GitHub token with packages:write, id-token:write permissions" | |
required: true | |
# Dry run on dispatch: | |
workflow_dispatch: | |
# Dry run for main: | |
push: | |
branches: ["main"] | |
paths-ignore: ["**/*.md"] | |
# Build release container: | |
tags: | |
- "v*.*" | |
- "v*.*.*" | |
# Dry run for PRs: | |
pull_request: | |
branches: ["main"] | |
paths-ignore: ["**/*.md"] | |
permissions: | |
contents: write | |
jobs: | |
maven: | |
name: Maven Build | |
runs-on: "ubuntu-24.04" | |
# typical duration is ~2min, set a reasonable amount as limit (default is 6h) | |
timeout-minutes: 8 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: llamara-ai/llamara-backend | |
ref: ${{ inputs.ref }} | |
- name: Download frontend build | |
if: github.repository == 'llamara-ai/llamara-distro' | |
uses: actions/download-artifact@v4 | |
with: | |
name: vite-dist | |
path: src/main/resources/META-INF/resources | |
- name: Maven Build | |
uses: ./.github/actions/maven-build | |
with: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
# Upload the full dependency graph to improve quality of Dependabot alerts except on PR | |
- name: Update dependency graph | |
if: github.repository == 'llamara-ai/llamara-backend' && github.event_name == 'push' && github.ref_name == 'main' | |
uses: advanced-security/maven-dependency-submission-action@v4 | |
- name: Upload packaged application | |
uses: actions/upload-artifact@v4 | |
with: | |
name: quarkus-app | |
path: | | |
target/quarkus-app | |
- name: Upload OpenAPI schema | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openapi-schema | |
path: | | |
target/openapi | |
- name: Upload test coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco-report | |
path: | | |
target/jacoco-report | |
# pinning to SHA to mitigate possible supply chain attack | |
- name: Trigger distro build | |
if: github.repository == 'llamara-ai/llamara-backend' && github.event_name == 'push' && github.ref_name == 'main' | |
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0 | |
with: | |
token: ${{ secrets.DISTRO_DISPATCH_BUILD_TOKEN }} | |
repository: llamara-ai/llamara-distro | |
event-type: build | |
docker: | |
name: Docker Build & Publish | |
needs: maven | |
runs-on: "ubuntu-24.04" | |
# typical duration is ~1min, set a reasonable amount as limit (default is 6h) | |
timeout-minutes: 4 | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ inputs.container-image-name || github.repository }} | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: llamara-ai/llamara-backend | |
ref: ${{ inputs.ref }} | |
# Install the cosign tool | |
# https://github.com/sigstore/cosign-installer | |
# pinning to SHA to mitigate possible supply chain attack | |
- name: Install cosign | |
if: ${{ github.event_name == 'workflow_call' || (github.event_name == 'push' && github.ref_name != 'main') }} | |
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1 | |
with: | |
cosign-release: "v2.4.3" | |
# Set up BuildKit Docker container builder to be able to build | |
# multi-platform images and export cache | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Login against a Docker registry | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
if: ${{ github.event_name == 'workflow_call' || (github.event_name == 'push' && github.ref_name != 'main') }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.github-token || secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
labels: | | |
org.opencontainers.image.title=LLAMARA ${{ inputs.container-image-type || 'Backend' }} | |
org.opencontainers.image.vendor=LLAMARA AI project | |
org.opencontainers.image.authors=Contributors to the LLAMARA AI project | |
- name: Download packaged application | |
uses: actions/download-artifact@v4 | |
with: | |
name: quarkus-app | |
path: target/quarkus-app | |
# Build and push Docker image with Buildx | |
# Push only on workflow_call or pushing a version tag | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: src/main/docker/Dockerfile.jvm | |
context: . | |
push: ${{ github.event_name == 'workflow_call' || (github.event_name == 'push' && github.ref_name != 'main') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# Sign the resulting Docker image digest. | |
# This will only write to the public Rekor transparency log when the Docker | |
# repository is public to avoid leaking data. If you would like to publish | |
# transparency data even for private images, pass --force to cosign below. | |
# https://github.com/sigstore/cosign | |
- name: Sign the published Docker image | |
if: ${{ github.event_name == 'workflow_call' || (github.event_name == 'push' && github.ref_name != 'main') }} | |
env: | |
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | |
TAGS: ${{ steps.meta.outputs.tags }} | |
DIGEST: ${{ steps.build-and-push.outputs.digest }} | |
# This step uses the identity token to provision an ephemeral certificate | |
# against the sigstore community Fulcio instance. | |
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} |