name: Docker Hub
on:
  push:
    branches:
      - master
jobs:
  push:
    runs-on: ubuntu-latest
    if: github.event_name == 'push'
    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK 17 for deploy to Docker Hub
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '17'
          server-id: docker.io

      - name: Cache local Maven repository
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Publish to Docker Hub
        run: mvn spring-boot:build-image -Dspring-boot.build-image.imageName=docker.io/fred4jupiter/fredbet
name: Docker Hub
on:
  push:
    branches:
      - master
jobs:
  push:
    runs-on: ubuntu-latest
    if: github.event_name == 'push'
    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK 17 for deploy to Docker Hub
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '17'
          server-id: docker.io

      - name: Cache local Maven repository
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_TOKEN }}

      - name: Publish to Docker Hub
        run: mvn compile com.google.cloud.tools:jib-maven-plugin:3.1.4:build -Dimage=docker.io/fred4jupiter/fredbet
Revert "changed to build docker image with spring boot"
Revert "changed to build docker image with spring boot"

This reverts commit 69d89205e7f85ab86a3a047abd5523bb040e01b3.
