diff --git a/.github/actions/deploy-site/action.yml b/.github/actions/deploy-site/action.yml deleted file mode 100644 index d4d2e8a03..000000000 --- a/.github/actions/deploy-site/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Deploy Site' -description: 'Deploy site to GitHub Pages' - -runs: - using: 'composite' - steps: - - uses: gradle/actions/setup-gradle@v4 - with: - cache-read-only: true - - name: Prepare API documentation - shell: bash - run: ./gradlew dokkaHtml - - name: Build Site - shell: bash - run: | - # Don't cache it to track updates. - pip install mkdocs-material - mkdocs build - - uses: actions/upload-pages-artifact@v3 - with: - path: site - - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1be19d144..a07bac0ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,7 @@ name: Deploy on: + workflow_call: workflow_dispatch: jobs: @@ -10,9 +11,21 @@ jobs: environment: name: github-pages permissions: - contents: write id-token: write pages: write steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/deploy-site + - uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: true + - name: Prepare API documentation + run: ./gradlew dokkaHtml + - name: Build Site + run: | + # Don't cache it to track updates. + pip install mkdocs-material + mkdocs build + - uses: actions/upload-pages-artifact@v3 + with: + path: site + - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b77555ac..245de4902 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,9 @@ jobs: runs-on: ubuntu-latest if: github.event.repository.fork == false environment: - name: github-pages + name: maven-central permissions: contents: write - id-token: write - pages: write steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -33,7 +31,6 @@ jobs: ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} - - uses: ./.github/actions/deploy-site - name: Extract release notes uses: ffurrer2/extract-release-notes@v2 with: @@ -43,3 +40,7 @@ jobs: run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + deploy: + needs: release + uses: ./.github/workflows/deploy.yml