2025-04-09 09:09:02 +00:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Repository meta
|
|
|
|
id: repository
|
|
|
|
run: |
|
|
|
|
registry=${{ github.server_url }}
|
|
|
|
registry=${registry##http*://}
|
|
|
|
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
|
|
|
|
echo "registry=${registry}"
|
|
|
|
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
|
2025-04-24 11:56:20 +00:00
|
|
|
repository="${repository%:main}"
|
2025-04-09 09:09:02 +00:00
|
|
|
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
|
|
|
|
echo "repository=${repository}"
|
|
|
|
- name: Docker meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
id: docker
|
|
|
|
with:
|
|
|
|
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
|
|
|
|
- name: Login to registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ${{ steps.repository.outputs.registry }}
|
|
|
|
username: ${{ secrets.PACKAGES_USER }}
|
|
|
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
with:
|
|
|
|
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
|
|
|
driver-opts: network=host
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
2025-04-14 09:30:17 +00:00
|
|
|
- name: Install Java (OpenJDK 11)
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y openjdk-11-jdk
|
|
|
|
echo "JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac))))" >> $GITHUB_ENV
|
2025-04-14 09:04:18 +00:00
|
|
|
- name: Install Maven
|
|
|
|
run: |
|
2025-04-14 09:34:45 +00:00
|
|
|
wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
|
|
|
|
tar -xvzf apache-maven-3.9.9-bin.tar.gz
|
|
|
|
sudo mv apache-maven-3.9.9 /opt/maven
|
2025-04-14 09:31:59 +00:00
|
|
|
echo "/opt/maven/bin" >> $GITHUB_PATH
|
2025-04-14 08:33:03 +00:00
|
|
|
- name: Update version
|
2025-04-14 08:34:55 +00:00
|
|
|
run: |
|
2025-04-14 08:56:44 +00:00
|
|
|
chmod +x update-version.sh
|
|
|
|
./update-version.sh
|
2025-04-24 12:18:48 +00:00
|
|
|
git push origin HEAD:${{ github.ref_name }}
|
2025-04-24 11:33:49 +00:00
|
|
|
- name: Extract version from pom.xml
|
|
|
|
id: get-version
|
|
|
|
run: |
|
2025-04-24 11:30:05 +00:00
|
|
|
TAG=$(awk '/<version>/ {count++; if(count == 2) print $0}' pom.xml | sed -n 's|.*<version>\([^<]*\)</version>.*|\1|p')
|
2025-04-24 11:38:18 +00:00
|
|
|
TAG=$(echo "$TAG" | tr '[:upper:]' '[:lower:]')
|
2025-04-24 11:33:49 +00:00
|
|
|
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
2025-04-09 09:09:02 +00:00
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
allow: network.host
|
|
|
|
network: host
|
|
|
|
platforms: linux/arm64
|
2025-04-24 11:59:35 +00:00
|
|
|
tags: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}:${{ steps.get-version.outputs.tag }}
|