name: Build

on:
  push:
    branches: 
      - master
  pull_request:

jobs:
  build:
    name: "Build"
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - id: get_version
        name: "Get Version"
        uses: battila7/get-version-action@v2
      - name: "Build"
        uses: eskatos/gradle-command-action@v1
        with:
           arguments: build --info
      - name: Release on Tag
        if: startsWith(github.ref, 'refs/tags/v')
        uses: eskatos/gradle-command-action@v1
        env:
          ORG_GRADLE_PROJECT_bintrayApiKey: ${{ secrets.ORG_GRADLE_PROJECT_BINTRAYAPIKEY }}
          ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
        with: 
          arguments: release --info "-PreleaseVersion=${{ steps.get_version.outputs.version }}"

name: Build

on:
  push:
    branches: 
      - master
  pull_request:

jobs:
  build:
    name: "Build"
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - id: get_version
        name: "Get Version"
        uses: battila7/get-version-action@v2
      - name: "Build"
        uses: eskatos/gradle-command-action@v1
        with:
           arguments: build --info
           dependencies-cache-enabled: true
      - name: Release on Tag
        if: startsWith(github.ref, 'refs/tags/v')
        uses: eskatos/gradle-command-action@v1
        env:
          ORG_GRADLE_PROJECT_bintrayApiKey: ${{ secrets.ORG_GRADLE_PROJECT_BINTRAYAPIKEY }}
          ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
        with: 
          arguments: release --info "-PreleaseVersion=${{ steps.get_version.outputs.version }}"
          dependencies-cache-enabled: true

Enable dependency caching in Github actions
Enable dependency caching in Github actions