Skip to content

Commit 3f5bdaf

Browse files
authored
chore: Add documentation to publishing. (#33)
1 parent c6b2edf commit 3f5bdaf

3 files changed

Lines changed: 41 additions & 1 deletion

File tree

.github/actions/ci/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ runs:
3636
if: steps.build.outcome == 'success' && inputs.run_tests == 'true'
3737
shell: bash
3838
run: ./gradlew test
39+
40+
- name: Build Documentation
41+
shell: bash
42+
run: ./gradlew javadoc

.github/workflows/publish-docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Manual Publish Documentation
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build-and-publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
id-token: read # No OIDC needed.
10+
contents: write # For publishing documentation.
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: CI check
15+
uses: ./.github/actions/ci
16+
with:
17+
run_tests: 'false'
18+
java_version: '11'
19+
20+
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1
21+
name: 'Publish to Github pages'
22+
with:
23+
docs_path: build/docs/javadoc
24+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
permissions:
3737
id-token: write
38-
contents: read
38+
contents: write # For publishing documentation.
3939
steps:
4040
- uses: actions/checkout@v4
4141

@@ -64,3 +64,15 @@ jobs:
6464
code_signing_keyring: 'code-signing-keyring.gpg'
6565
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
6666
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
67+
68+
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1
69+
name: 'Publish to Github pages'
70+
if: ${{ inputs.dry_run == 'false' }}
71+
with:
72+
docs_path: build/docs/javadoc
73+
github_token: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Dry Run Publish Docs
76+
shell: bash
77+
if: ${{ inputs.dry_run == 'true' }}
78+
run: echo "Dry run. Not publishing docs."

0 commit comments

Comments
 (0)