Java CI with Maven #41
Workflow file for this run
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: Java CI with Maven | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
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 |