message: Publish to docker hub on tag.
diff: name: Publish Containers
  on:
  push:
  - branches: [main]
  + branches:
  + - main
  + # Publish semver tags as releases.
  + tags:
  + - 'v*.*.*'
  jobs:
  pipeline:
  name: JHipster Registry Docker
  @@ -56,3 +60,23 @@ jobs:
  run: docker container logs jhipster-registry
  - name: 'DOCKER: curl 8761'
  run: curl -v http://localhost:8761
  +
  + - name: Extract Docker metadata
  + id: meta
  + uses: docker/metadata-action@v3
  + with:
  + images: jhipster/jhipster-registry
  + tags: |
  + type=semver,pattern=v{{version}}
  + - name: Login to Docker Registry
  + env:
  + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  + if: ${{env.DOCKERHUB_USERNAME != '' && startsWith(github.ref, 'refs/tags/v')}}
  + uses: docker/login-action@v1
  + id: login-hub
  + with:
  + username: ${{ secrets.DOCKERHUB_USERNAME }}
  + password: ${{ secrets.DOCKERHUB_TOKEN }}
  + - name: Publish to Docker Hub
  + if: ${{steps.login-hub.outcome == 'success'}}
  + run: ./mvnw -ntp verify -DskipTests -Pprod jib:build -Dimage=jhipster/jhipster-registry -Djib.to.tags='${{ steps.meta.outputs.version }},latest'
  