Skip to content

Commit 8f09574

Browse files
committed
Add api generation workflow to CI
Signed-off-by: Stoyan Petrov <stoyan@petrov.ca>
1 parent 4e2f953 commit 8f09574

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,9 @@ jobs:
176176
secrets:
177177
MEND_EMAIL: ${{ secrets.MEND_EMAIL }}
178178
MEND_USER_KEY: ${{ secrets.MEND_USER_KEY }}
179-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
179+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
180+
181+
# Run dokka
182+
generate-docs:
183+
name: Generate API docs
184+
uses: ./.github/workflows/docs.yaml

.github/workflows/docs.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Generate API Docs
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-docs:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Java
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: 17
29+
30+
- name: Set up Gradle
31+
uses: gradle/actions/setup-gradle@v4
32+
33+
- name: Generate Dokka HTML
34+
run: ./gradlew clean dokkaGeneratePublicationHtml
35+
36+
- name: Verify docs output
37+
run: |
38+
test -f build/dokka/html/index.html
39+
ls -la build/dokka/html
40+
41+
- name: Configure Pages
42+
uses: actions/configure-pages@v5
43+
44+
- name: Upload Pages artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: build/dokka/html
48+
49+
deploy-docs:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build-docs
55+
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)