Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 2cdc726

Browse files
committed
Build/deploy KDoc over artifact instead of gh-pages branch
1 parent 0133bea commit 2cdc726

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

.github/workflows/build-kdoc.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
name: Build KDoc
1+
name: Build and publish KDoc
22
on:
33
push:
44
branches: [main]
5+
6+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
512
jobs:
613
build:
7-
name: Build and publish KDoc
814
runs-on: ubuntu-latest
915
steps:
1016
- uses: actions/checkout@v2
@@ -15,12 +21,19 @@ jobs:
1521
- uses: gradle/gradle-build-action@v2
1622

1723
- name: Build KDoc
18-
run: ./gradlew dokkaHtml
19-
- name: Publish KDoc
20-
if: success()
21-
uses: crazy-max/ghaction-github-pages@v3
24+
run: ./gradlew --no-daemon dokkaHtml
25+
26+
- uses: actions/upload-pages-artifact@v1
2227
with:
23-
target_branch: gh-pages
24-
build_dir: build/dokka/html
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
path: build/dokka/html
29+
30+
deploy:
31+
environment:
32+
name: github-pages
33+
url: ${{ steps.deployment.outputs.page_url }}
34+
runs-on: ubuntu-latest
35+
needs: build
36+
steps:
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)