Skip to content

Merge pull request #80 from BjoernKW/dependabot/github_actions/action… #129

Merge pull request #80 from BjoernKW/dependabot/github_actions/action…

Merge pull request #80 from BjoernKW/dependabot/github_actions/action… #129

name: Publish Docker image
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
build_push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: bjoernkw/mailtrigger:latest