Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Build

on:
workflow_run:
workflows: ["Linux GitHub CI"]
types:
- completed

jobs:
build-docker:
if: >
github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'ghaction-docker')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# The checkout action is required to access the repository files,
# including the Dockerfile.
# It needs to checkout the specific commit that triggered the 'Linux GitHub CI' workflow.
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gn-image/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/geonetwork:${{ github.event.workflow_run.head_branch }}
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
submodules: 'recursive'
show-progress: 'false'
- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
submodules: 'recursive'
show-progress: 'false'
- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 11
Expand All @@ -67,7 +67,7 @@ jobs:
- name: Test with maven
run: |
mvn -B resources:resources@copy-index-schema-to-source -f web
mvn -B -ntp -V -fae verify -Drelesae -Pit
mvn -B -ntp -V -fae verify -Drelease -Pit
- name: Check for uncommitted changes such as formatting changes
run: |
if [[ -n "$(git status -s)" ]]; then
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ transifex/transifex-format/
build/
web-ui/LICENSE
web-ui/tx
plugins/datahub-integration/node/

# web-app, clear using: mvn -f web/pom.xml clean:clean@reset

Expand Down
20 changes: 20 additions & 0 deletions docker/gn-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build stage
FROM maven:3.8-jdk-11 AS builder

WORKDIR /usr/src/geonetwork

# Copy the entire project
COPY . .

# Build the project and create the WAR file
# The command is taken from the release-build.sh script
RUN mvn clean install -DskipTests -ntp -Pwar -Pwro4j-prebuild-cache

# Runtime stage
FROM jetty:9-jre11

# The geonetwork.war file is in web/target/
COPY --from=builder /usr/src/geonetwork/web/target/geonetwork.war /var/lib/jetty/webapps/geonetwork.war

# Expose the default Jetty port
EXPOSE 8080