Skip to content

Commit 670a762

Browse files
committed
fix dokka workflow
1 parent d20ac3c commit 670a762

File tree

1 file changed

+13
-37
lines changed

1 file changed

+13
-37
lines changed

.github/workflows/github-pages.yml

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
2-
name: Deploy to GitHub Pages
1+
# Workflow for building and deploying Dokka documentation to GitHub Pages
2+
name: Deploy Dokka Docs to GitHub Pages
33

44
on:
55
# Runs on pushes targeting the default branch
@@ -16,60 +16,36 @@ permissions:
1616
id-token: write
1717

1818
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2019
concurrency:
2120
group: "pages"
2221
cancel-in-progress: false
2322

24-
env:
25-
JEKYLL_OUTPUT_DIR: ./dist
26-
DOKKA_ARTIFACT_NAME: dokka-html
27-
2823
jobs:
29-
api-docs:
30-
name: Generate Dokka HTML docs
24+
# Build and upload the Dokka documentation
25+
build-and-upload:
26+
name: Generate and Upload Dokka Docs
3127
runs-on: macos-latest # For Kotlin/Native
3228
steps:
33-
- name: Checkout
29+
- name: Checkout repository
3430
uses: actions/checkout@v4
31+
3532
- name: Configure JDK
3633
uses: actions/setup-java@v4
3734
with:
3835
distribution: 'temurin'
3936
java-version: 17
37+
4038
- name: Generate Dokka HTML docs
4139
run: ./gradlew :dokkaHtml
42-
- name: Upload Dokka output
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: ${{ env.DOKKA_ARTIFACT_NAME }}
46-
path: build/dokka/html
47-
if-no-files-found: error
48-
# Build job
49-
build:
50-
name: Build Jekyll docs
51-
runs-on: ubuntu-latest
52-
needs: api-docs
53-
steps:
54-
# Workaround for https://github.com/actions/jekyll-build-pages/issues/101
55-
- name: Create output directory
56-
run: mkdir ${{ env.JEKYLL_OUTPUT_DIR }}
40+
5741
- name: Setup Pages
5842
uses: actions/configure-pages@v5
59-
- name: Build with Jekyll
60-
uses: actions/jekyll-build-pages@v1
61-
with:
62-
source: ./
63-
destination: ${{ env.JEKYLL_OUTPUT_DIR }}
64-
- name: Download Dokka artifact
65-
uses: actions/download-artifact@v4
66-
with:
67-
name: ${{ env.DOKKA_ARTIFACT_NAME }}
68-
path: ${{ env.JEKYLL_OUTPUT_DIR }}/api
43+
6944
- name: Upload artifact
7045
uses: actions/upload-pages-artifact@v3
7146
with:
72-
path: ${{ env.JEKYLL_OUTPUT_DIR }}
47+
# Upload the generated Dokka HTML directory
48+
path: build/dokka/html
7349

7450
# Deployment job
7551
deploy:
@@ -78,7 +54,7 @@ jobs:
7854
name: github-pages
7955
url: ${{ steps.deployment.outputs.page_url }}
8056
runs-on: ubuntu-latest
81-
needs: build
57+
needs: build-and-upload # Wait for the build job to finish
8258
steps:
8359
- name: Deploy to GitHub Pages
8460
id: deployment

0 commit comments

Comments
 (0)