feat: update dockerhub documentation #1
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: "Build and publish docker image" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: "Checking out" | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: "Setting up Java" | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
cache: 'maven' | |
- name: "Build gateway" | |
run: make install test | |
- name: "Resolve docker image tag" | |
id: version | |
run: echo ::set-output name=VERSION::$(./mvnw -f gateway/ help:evaluate -q -DforceStdout -Dexpression=imageTag) | |
- name: "Build docker image" | |
if: github.repository == 'georchestra/georchestra-gateway' | |
run: make docker | |
- name: "Log in to docker.io" | |
if: github.repository == 'georchestra/georchestra-gateway' | |
uses: azure/docker-login@v1 | |
with: | |
username: '${{ secrets.DOCKER_HUB_USERNAME }}' | |
password: '${{ secrets.DOCKER_HUB_PASSWORD }}' | |
- name: "Push latest to docker.io" | |
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' | |
run: docker push georchestra/gateway:latest | |
- name: "Push tagged image to docker.io" | |
if: github.ref != 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' | |
run: docker push georchestra/gateway:${{ steps.version.outputs.VERSION }} | |
- name: "Update Gateway Docker Hub Description" | |
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
repository: georchestra/gateway | |
readme-filepath: ./DOCKER_HUB.md | |
short-description: 'Gateway module for the geOrchestra SDI' | |
- name: "Push image attached to commit id to docker.io" | |
if: github.ref == 'refs/heads/main' && github.repository == 'georchestra/georchestra-gateway' | |
run: | | |
docker tag georchestra/gateway:latest georchestra/gateway:commit-${{ github.sha }} | |
docker push georchestra/gateway:commit-${{ github.sha }} | |
- name: "Remove SNAPSHOT jars from repository" | |
run: | | |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} |