name: Build/Push docker image
on:
  release:
    types: [published]
jobs:
  main:
    if: github.repository == 'oncokb/oncokb'
    name: Build and Push
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 8

      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Build the docker image and push
        env:
          TAG_NAME: ${{ github.event.release.tag_name }}
        run: |
          mvn -ntp package -DskipTests -P public,production
          docker push oncokb/oncokb:${TAG_NAME:1}

name: Build/Push docker image
on:
  release:
    types: [published]
jobs:
  main:
    if: github.repository == 'oncokb/oncokb'
    name: Build and Push
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: 8

      - name: Package application with Jib
        env:
          DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
          DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
          TAG_NAME: ${{ github.event.release.tag_name }}
          REPOSITORY: ${{ github.repository }}
        run: |
          mvn -ntp package -P public,production \
          -DskipTests \
          -Djib.to.image="${REPOSITORY}:${TAG_NAME}" \
          -Djib.to.auth.username=$DOCKER_USERNAME \
          -Djib.to.auth.password=$DOCKER_PASSWORD

Update docker release to use jib and tag name from github
Update docker release to use jib and tag name from github
