Skip to content

Merge pull request #365 from cescoffier/dependabot/maven/fight-servic… #743

Merge pull request #365 from cescoffier/dependabot/maven/fight-servic…

Merge pull request #365 from cescoffier/dependabot/maven/fight-servic… #743

Workflow file for this run

name: Build
env:
JVM_VERSION: '21'
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
pages: write
strategy:
fail-fast: false
matrix:
app:
- hero-service
- villain-service
- fight-service
- fight-ui
name: "Build ${{ matrix.app }}"
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ env.JVM_VERSION }}
distribution: temurin
cache: maven
- name: Maven Build for ${{ matrix.app }}
working-directory: ${{ matrix.app }}
run: ./mvnw -B clean verify -Dquarkus.http.host=0.0.0.0 -DskipITs=false
- name: Log in to the Container registry
uses: docker/login-action@v3.4.0
if: github.ref == 'refs/heads/main'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for the container
id: meta
uses: docker/metadata-action@v5.7.0
if: github.ref == 'refs/heads/main'
with:
images: ghcr.io/cescoffier/quarkus-openshift-workshop-${{ matrix.app }}
- name: Build and push image for ${{ matrix.app }}
id: push
uses: docker/build-push-action@v6
if: github.ref == 'refs/heads/main'
with:
context: ${{ matrix.app }}
file: ${{ matrix.app }}/src/main/docker/Dockerfile.jvm
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation for ${{ matrix.app }}
uses: actions/attest-build-provenance@v2
if: github.ref == 'refs/heads/main'
with:
subject-name: ghcr.io/cescoffier/quarkus-openshift-workshop-${{ matrix.app }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: ${{ github.event_name != 'pull_request' }}
docs:
runs-on: ubuntu-latest
name: "Build Docs"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/setup-java@v4
name: Set up Java 21
with:
java-version: 21
distribution: temurin
cache: maven
- name: Generate documentation
working-directory: docs
run: |
pip install pipenv
pipenv install
pipenv run mkdocs build --clean
- name: Publish documentation
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site