|
14 | 14 | jobs: |
15 | 15 | build: |
16 | 16 | if: "!startsWith(github.event.head_commit.message, '[skip ci] ')" |
17 | | - name: "📦 Build and test GeoNetwork" |
| 17 | + name: "📦 Build, test and publish on Docker Hub" |
18 | 18 | runs-on: ubuntu-latest |
19 | 19 | timeout-minutes: 40 |
20 | 20 | steps: |
@@ -42,27 +42,15 @@ jobs: |
42 | 42 | name: geonetwork.war |
43 | 43 | path: web/target/geonetwork.war |
44 | 44 |
|
45 | | - build-docker: |
46 | | - needs: build |
47 | | - if: github.event_name != 'issue_comment' || needs.checks.outputs.shouldRun |
48 | | - name: "🐳 Build and upload docker images" |
49 | | - runs-on: ubuntu-latest |
50 | | - steps: |
51 | 45 | - name: Getting image tag |
52 | 46 | if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' |
53 | 47 | id: version |
54 | 48 | run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT |
55 | 49 |
|
56 | | - - name: "Checking out" |
57 | | - uses: actions/checkout@v2.4.0 |
58 | | - with: |
59 | | - submodules: 'recursive' |
60 | | - |
61 | | - - name: "Build GeoNetwork docker image" |
| 50 | + - name: "🐳 Build GeoNetwork docker image" |
62 | 51 | if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' |
63 | 52 | run: | |
64 | | - mvn -DskipTests -Pdatahub-integration clean install; |
65 | | - cd geonetwork/web |
| 53 | + cd web |
66 | 54 | mvn package -Pdocker,datahub-integration -DdockerImageName=georchestra/geonetwork -DdockerImageTags=${{ steps.version.outputs.VERSION }},latest -DskipTests -ntp |
67 | 55 |
|
68 | 56 | - name: "Logging in docker.io" |
|
78 | 66 | docker push georchestra/geonetwork:latest |
79 | 67 |
|
80 | 68 | - name: "Pushing release branch to docker.io" |
81 | | - if: contains(github.ref, 'refs/heads/24.') && github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' |
82 | | - run: | |
83 | | - docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }} |
84 | | -
|
85 | | - - name: "Pushing release tag to docker.io" |
86 | | - if: contains(github.ref, 'refs/tags/24.') && github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' |
| 69 | + if: (contains(github.ref, 'refs/tags/') || endsWith(github.ref, '.x')) && github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' |
87 | 70 | run: | |
88 | 71 | docker push georchestra/geonetwork:${{ steps.version.outputs.VERSION }} |
89 | 72 |
|
|
0 commit comments