docs: update docker hub #115
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI with Maven | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: Build with Maven | |
run: ./mvnw verify --file pom.xml -ntp | |
- name: Build a docker image | |
run: ./mvnw clean package -Pdocker -ntp | |
- name: "Resolve docker image tag" | |
id: version | |
run: echo ::set-output name=VERSION::$(./mvnw -f src/services/ogc-features/ help:evaluate -q -DforceStdout -Dexpression=project.version -ntp) | |
- name: Login to DockerHub | |
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: push the docker image | |
if: github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && (github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) | |
run: | | |
docker push georchestra/data-api:${{ steps.version.outputs.VERSION }} | |
docker push georchestra/data-api:latest | |
- name: "Update Docker Hub Description" | |
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/data-api' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: georchestra/data-api | |
readme-filepath: ./DOCKER_HUB.md | |
short-description: 'OGC API Features implementation module for the geOrchestra SDI' | |
- name: "Remove SNAPSHOT jars from repository" | |
run: | | |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} | |