name: Publish to GitHub Packages
on:
  push:
    branches: [ main ]
    paths-ignore:
      - docs/**
env:
  ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SONATYPE_SIGNING_KEY }}
  ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '17'
      - name: Publish to GitHub Packages
        uses: burrunan/gradle-cache-action@v1
        with:
          gradle-version: wrapper
          arguments: publishAllPublicationsToGithubPackagesRepository
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
