diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 3fcafb4..1cccf5e 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -19,5 +19,24 @@ jobs: distribution: 'temurin' cache: maven + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + version: latest + - name: Build with Maven run: mvn -B verify --file pom.xml + + - name: Build a docker image + run: mvn clean package -Pdocker + + - name: Login to DockerHub + if: github.repository == 'camptocamp/mel-data-api' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: push the docker image + if: github.repository == 'camptocamp/mel-data-api' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main' + run: docker push camptocamp/opendata-ogc-features:latest