diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index f79ceb4..475e0f4 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -36,3 +36,7 @@ runs: if: steps.build.outcome == 'success' && inputs.run_tests == 'true' shell: bash run: ./gradlew test + + - name: Build Documentation + shell: bash + run: ./gradlew javadoc diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..080c3cb --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,24 @@ +name: Manual Publish Documentation +on: + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + id-token: read # No OIDC needed. + contents: write # For publishing documentation. + steps: + - uses: actions/checkout@v4 + + - name: CI check + uses: ./.github/actions/ci + with: + run_tests: 'false' + java_version: '11' + + - uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1 + name: 'Publish to Github pages' + with: + docs_path: build/docs/javadoc + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9da3b73..03f5c68 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write - contents: read + contents: write # For publishing documentation. steps: - uses: actions/checkout@v4 @@ -64,3 +64,15 @@ jobs: code_signing_keyring: 'code-signing-keyring.gpg' sonatype_username: ${{ env.SONATYPE_USER_NAME }} sonatype_password: ${{ env.SONATYPE_PASSWORD }} + + - uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1 + name: 'Publish to Github pages' + if: ${{ inputs.dry_run == 'false' }} + with: + docs_path: build/docs/javadoc + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Dry Run Publish Docs + shell: bash + if: ${{ inputs.dry_run == 'true' }} + run: echo "Dry run. Not publishing docs."