Files
2026-05-25 07:26:00 +02:00

48 lines
1.5 KiB
YAML

name: Release
on:
release:
types: [published]
jobs:
docker:
name: Build & push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Install Java 25
run: |
wget -q https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.3%2B9/OpenJDK25U-jdk_x64_alpine-linux_hotspot_25.0.3_9.tar.gz
tar -xzf OpenJDK25U-jdk_x64_alpine-linux_hotspot_25.0.3_9.tar.gz -C /opt
echo "JAVA_HOME=/opt/jdk-25.0.3+9" >> $GITHUB_ENV
echo "/opt/jdk-25.0.3+9/bin" >> $GITHUB_PATH
- name: Build JAR
run: ./gradlew build -x test
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Login to Gitea container registry
uses: https://github.com/docker/login-action@v3
with:
registry: git.goutailler-olivier.com
username: ${{ gitea.actor }}
password: ${{ secrets.RELEASE_TOKEN }}
- name: Set lowercase repo name
id: repo
run: echo "name=$(echo '${{ gitea.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and push
uses: https://github.com/docker/build-push-action@v6
with:
context: .
push: true
tags: |
git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:${{ gitea.ref_name }}
git.goutailler-olivier.com/${{ steps.repo.outputs.name }}:latest