name: Service CI

on:
  push:
    branches-ignore:
      - gh-pages

jobs:
  build:
    runs-on: ubuntu-latest
    container: ubuntu:22.04

    steps:
      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      - name: Set up JDK 21
        uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
        with:
          distribution: 'temurin'
          java-version: 21
          cache: 'maven'
        env:
          # work around an issue with actions/runner setting an incorrect HOME in containers, which breaks maven caching
          # https://github.com/actions/setup-java/issues/356
          HOME: /root
      - name: Install APT packages
        # ca-certificates: required for AWS CRT client
        run: apt update && apt install -y ca-certificates
      - name: Build with Maven
        run: ./mvnw -e -B verify
