name: Release
on:
  push:
    branches:
      - master

jobs:
  build:
    name: "Stable Release"
    runs-on: ubuntu-latest
    environment: production
    services:
      mongodb:
        image: mongo:3.2
        ports:
          - 27017:27017
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '8'
      - name: Run checks
        run: ./gradlew clean check --stacktrace
      - name: Release
        run: ./gradlew -Dorg.ajoberstar.grgit.auth.username=USER -Dorg.ajoberstar.grgit.auth.password=${{ secrets.GITHUB_TOKEN }} final
      - name: Set release version
        id: var
        run: echo "::set-output name=release_version::$(git tag --sort=taggerdate | grep -E '^v[0-9]' | tail -1 | cut -c2-)"
      - name: Build Shadow Jar
        run: ./gradlew clean assemble
      - name: Log in to Docker Hub
        run: |
          docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
      - name: Build Docker image
        run: |
          docker build -t sdkman/sdkman-broker:${{ steps.var.outputs.release_version }} -f Dockerfile .
      - name: Push to Docker Hub
        run: |
          docker push sdkman/sdkman-broker:${{ steps.var.outputs.release_version }}

name: Release
on:
  push:
    branches:
      - master

jobs:
  build:
    name: "Stable Release"
    runs-on: ubuntu-latest
    environment: production
    services:
      mongodb:
        image: mongo:3.2
        ports:
          - 27017:27017
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '8'
      - name: Run checks
        run: ./gradlew clean check --stacktrace
      - name: Release
        run: ./gradlew -Dorg.ajoberstar.grgit.auth.username=USER -Dorg.ajoberstar.grgit.auth.password=${{ secrets.GITHUB_TOKEN }} final
      - name: Set release version
        id: var
        run: echo "::set-output name=release_version::$(git tag --sort=taggerdate | grep -E '^v[0-9]' | tail -1 | cut -c2-)"
      - name: Assemble
        run: ./gradlew clean assemble
      - name: Log in to Docker Hub
        run: |
          docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
      - name: Build Docker image
        run: |
          docker build -t sdkman/sdkman-broker:${{ steps.var.outputs.release_version }} -f Dockerfile .
      - name: Push to Docker Hub
        run: |
          docker push sdkman/sdkman-broker:${{ steps.var.outputs.release_version }}

Update name of Assemble in PR workflow.
Update name of Assemble in PR workflow.
