name: Build Gradle

on:
  push:
    branches:
      - '*'
      - '!gh_pages'
  pull_request:
    branches:
      - '*'
      - '!gh_pages'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Build with Gradle
      run: ./gradlew check --stacktrace
    - name: Deploy snapshot
      run: ./gradlew publishAllPublicationsToSonatypeSnapshotsRepository --stacktrace
      if: github.ref == 'main'
      env:
        SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
        SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

name: Build Gradle

on:
  push:
    branches:
      - '*'
      - '!gh_pages'
  pull_request:
    branches:
      - '*'
      - '!gh_pages'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - name: Build with Gradle
      run: ./gradlew check --stacktrace
    - name: Deploy snapshot
      run: ./gradlew publishAllPublicationsToSonatypeSnapshotsRepository --stacktrace
      if: github.ref == 'refs/heads/main'
      env:
        SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
        SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

Fix publishing snapshots on push
Fix publishing snapshots on push
