change deprecated method #268
This file contains 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: Publish Docker latest image | |
on: | |
push: | |
branches: | |
- 'dev' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_IMAGE: fred4jupiter/fredbet | |
DOCKER_TARGET_PLATFORM: linux/arm64/v8,linux/amd64 | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'adopt' | |
cache: 'maven' | |
- name: Cache local Maven repository | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn -B verify | |
- name: Publish Test Report | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Maven Tests | |
path: target/surefire-reports/*.xml | |
reporter: java-junit | |
fail-on-error: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
run: | | |
docker buildx build \ | |
--platform ${DOCKER_TARGET_PLATFORM} \ | |
--tag docker.io/${DOCKER_IMAGE}:latest \ | |
--tag ghcr.io/${DOCKER_IMAGE}:latest \ | |
--file ./Dockerfile-single \ | |
--output type=image,push=true . |