Skip to content

Merge pull request #282 from georchestra/backport/georchestra-gn4.2.x… #215

Merge pull request #282 from georchestra/backport/georchestra-gn4.2.x…

Merge pull request #282 from georchestra/backport/georchestra-gn4.2.x… #215

name: Building georchestra-geonetwork4 artifacts
on:
push:
branches:
- georchestra-gn4.2.x-23.0.x
pull_request:
workflow_dispatch:
env:
DOCKER_TAG: 23.0.x
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: "Checking out"
uses: actions/[email protected]
with:
submodules: 'recursive'
- name: "Checking out geOrchestra (needed for building dependencies)"
uses: actions/[email protected]
with:
repository: "georchestra/georchestra"
path: "georchestra"
ref: "23.0.x"
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: "Installing the geOrchestra root pom"
run: |
mvn install --non-recursive -f georchestra/pom.xml
- name: "Installing testcontainers georchestra module"
run: |
mvn clean install -f georchestra/testcontainers/pom.xml
- name: "Installing georchestra commons module"
run: |
mvn clean install -f georchestra/commons/pom.xml
- name: "Installing security-proxy-spring-integration georchestra module"
run: |
mvn clean install -f georchestra/security-proxy-spring-integration/pom.xml
- name: "Installing GeoNetwork"
run: mvn clean install -DskipTests
- name: "run tests"
run: mvn verify -Pit
- name: "Building the docker image"
working-directory: web/
run: |
mvn clean package docker:build -Pdocker,log4j-logstash,sentry-log4j \
-DdockerImageName=georchestra/geonetwork:${DOCKER_TAG} -DskipTests
- name: "publish the webapp as artifact"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v1
with:
name: geonetwork.war
path: web/target/geonetwork.war
- name: "Login onto docker-hub"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "Pushing branch image to docker-hub"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
run: |
docker push georchestra/geonetwork:${DOCKER_TAG}