-
Notifications
You must be signed in to change notification settings - Fork 18
59 lines (49 loc) · 3.32 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
on:
push:
pull_request:
release:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: "Checking out"
uses: actions/checkout@v2
- name: "Setting up Java"
uses: actions/setup-java@v3
with:
distribution : 'temurin'
java-version : '11'
cache: 'maven'
- name: "Run the testsuite"
run: ./mvnw clean install -P-docker --no-transfer-progress -B -Dspring-boot.build-image.imageName=docker.io/geonetwork/\${project.artifactId}:latest
- name: "Generate the docker images"
if: github.event_name == 'release' && github.event.action == 'created'
run: |
./mvnw install --no-transfer-progress -B -Pdocker -Dspring-boot.build-image.imageName=docker.io/geonetwork/\${project.artifactId}:latest
- name: "Get the version name"
if: github.event_name == 'release' && github.event.action == 'created'
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: "Login onto Docker Hub"
uses : docker/login-action@v2
if: github.repository == 'geonetwork/geonetwork-microservices' && github.event_name == 'release' && github.event.action == 'created'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
- name: "publish the docker images on docker-hub"
if: github.repository == 'geonetwork/geonetwork-microservices' && github.event_name == 'release' && github.event.action == 'created'
run: |
docker tag docker.io/geonetwork/gn-cloud-searching:latest docker.io/geonetwork/gn-cloud-searching:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-discovery:latest docker.io/geonetwork/gn-cloud-discovery:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-ogc-api-records-service:latest docker.io/geonetwork/gn-cloud-ogc-api-records-service:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-gateway:latest docker.io/geonetwork/gn-cloud-gateway:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-indexing:latest docker.io/geonetwork/gn-cloud-indexing:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-authorizing:latest docker.io/geonetwork/gn-cloud-authorizing:${{ steps.get_version.outputs.VERSION }}
docker tag docker.io/geonetwork/gn-cloud-configuring:latest docker.io/geonetwork/gn-cloud-configuring:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-searching:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-discovery:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-ogc-api-records-service:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-gateway:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-indexing:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-authorizing:${{ steps.get_version.outputs.VERSION }}
docker push docker.io/geonetwork/gn-cloud-configuring:${{ steps.get_version.outputs.VERSION }}