Skip to content

using a more recent version of georchestra commons [GSHDF-807] #192

using a more recent version of georchestra commons [GSHDF-807]

using a more recent version of georchestra commons [GSHDF-807] #192

name: CI
env:
# Note: Only used to tag the docker image
GEORCHESTRA_VERSION: gn4.2.x
on:
push:
workflow_dispatch:
branches:
- georchestra-gn4.2.x-geo2france
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: "Checking out"
uses: actions/[email protected]
with:
submodules: 'recursive'
- name: "Checking out geOrchestra (needed for building testcontainers)"
uses: actions/[email protected]
with:
repository: "georchestra/georchestra"
path: "georchestra"
ref: "master"
- name: Saving start date
run: |
date +%s%3N > start
- name: "Setting up Java"
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: "Configuring Maven"
run: |
mkdir -p $HOME/.m2
cp .github/resources/m2-settings.xml $HOME/.m2/settings.xml
- 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: "Building docker image"
working-directory: web/
run: mvn clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${GITHUB_RUN_ID} -DskipTests
- name: "Login onto ghcr.io"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: 'c2c-bot-gis-ci'
password: '${{ secrets.GOPASS_CI_GITHUB_TOKEN }}'
- name: "Pushing image to ghcr.io"
run: |
docker push ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${GITHUB_RUN_ID}
- name: "Slack notification"
uses: slackapi/[email protected]
with:
channel-id: 'CFQMVL8BG'
payload: |
{
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: "Publish a google-calendar event"
if: success()
uses: pmauduit/google-calendar-action@v1
with:
OAUTH_CLIENT_ID: '${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}'
OAUTH_CLIENT_SECRET: '${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}'
OAUTH_ACCESS_TOKEN: '${{ secrets.GOOGLE_OAUTH_ACCESS_TOKEN }}'
OAUTH_REFRESH_TOKEN: '${{ secrets.GOOGLE_OAUTH_REFRESH_TOKEN }}'
GCAL_ID: 'camptocamp.com_mpbq7llrcthk5qmmc0mkq7mlo0@group.calendar.google.com'
GCAL_EVENT_SUMMARY: 'Github actions - ${{ github.repository }}'
GCAL_EVENT_DESCRIPTION: "Image ghcr.io/camptocamp/georchestra-geo2france-configuration/geonetwork:${{ env.GEORCHESTRA_VERSION }}-${{ github.run_id }} built"