From 45f0fb06ae15f6ff130ed090bdb7f3625eeafce6 Mon Sep 17 00:00:00 2001 From: christophe mangeat Date: Thu, 24 Oct 2024 16:09:15 +0200 Subject: [PATCH] github workflow --- .github/workflows/geonetwork-docker.yml | 45 +++++++++---------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/.github/workflows/geonetwork-docker.yml b/.github/workflows/geonetwork-docker.yml index 6c99c26ebf..835bf5dad8 100644 --- a/.github/workflows/geonetwork-docker.yml +++ b/.github/workflows/geonetwork-docker.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - geocat_v4.2.3_report_custom* + - war-overlay jobs: build: @@ -12,44 +12,31 @@ jobs: steps: - name: "Checking out" - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - - name: "Setting up JDK 1.8" - uses: actions/setup-java@v1 + - name: "Setup java JDK" + uses: actions/setup-java@v4.2.1 with: - java-version: 1.8 - - - name: "Cache Maven packages" - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: "Update maven dependencies" - run: mvn -Pdocker de.qaware.maven:go-offline-maven-plugin:resolve-dependencies - - - name: Increase system limits - run: sudo sysctl -w vm.max_map_count=262144 - - - name: run tests - run: | - mvn resources:resources@copy-index-schema-to-source -f web - mvn clean verify -Pit - - name: "Installing" - run: mvn -B clean -DskipTests install -Ddb.username=db_username -Ddb.name=db_name -Ddb.type=postgres-postgis -Ddb.host=db_host -Ddb.password=db_password -Ddb.pool.maxActive=50 -Ddb.port=5432 + java-version: 11 + distribution: temurin + java-package: jdk + cache: maven - name: "Setting image tag" id: version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) - - name: "Building docker image" - run: mvn -pl web -Pdocker docker:build -DdockerImageName=docker.pkg.github.com/geoadmin/geocat/geocat:${{ steps.version.outputs.VERSION }}-${{ github.run_number }} + - name: "Build docker container" + run: | + mvn clean install -DskipTests -Denforcer.skip + mvn install:install-file -Dfile=core-geonetwork/web/target/geonetwork.war -DgroupId=org.geonetwork-opensource -DartifactId=web-app -Dversion=4.4.6-0 -Dpackaging=war + cd release/target/docker/ + docker build . -t docker.pkg.github.com/geoadmin/geocat/gn-with-swiss-overlay:${{ steps.version.outputs.VERSION }}-${{ github.run_number }} - name: "Login to docker.pkg.github.com" run: docker login -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com - - name: "Push to GitHub Packages" - run: docker push docker.pkg.github.com/geoadmin/geocat/geocat:${{ steps.version.outputs.VERSION }}-${{ github.run_number }} + - name: "Push to github packages" + run: docker push docker.pkg.github.com/geoadmin/geocat/gn-with-swiss-overlay:${{ steps.version.outputs.VERSION }}-${{ github.run_number }}