-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from huanshankeji/site-github-pages-deployment
Deploy the site to GitHub Pages
- Loading branch information
Showing
8 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Deploy the site to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [ "release" ] | ||
pull_request: | ||
branches: [ "release" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "11" | ||
distribution: "temurin" | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
- name: Build the distribution with Gradle Wrapper | ||
run: ./gradlew :generateSite | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: build/site/ | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
import org.jetbrains.dokka.gradle.tasks.DokkaGeneratePublicationTask | ||
|
||
tasks.wrapper { | ||
distributionType = Wrapper.DistributionType.ALL | ||
} | ||
|
||
plugins { | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
dependencies { | ||
listOf( | ||
"compose-html-common", | ||
"compose-html-material3" | ||
).forEach { | ||
dokka(project(":$it")) | ||
} | ||
} | ||
|
||
val dokkaGeneratePublicationHtml by tasks.getting(DokkaGeneratePublicationTask::class) | ||
tasks.register<Sync>("generateSite") { | ||
group = "site" | ||
|
||
val destRootDir = layout.buildDirectory.dir("site") | ||
into(destRootDir) | ||
from(dokkaGeneratePublicationHtml) { | ||
into("api-documentation") | ||
} | ||
from(layout.projectDirectory.dir("site")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
plugins { | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
dokka { | ||
dokkaSourceSets.all { | ||
sourceLink { | ||
remoteUrl("https://github.com/huanshankeji/compose-html-material/tree/v${version}/${project.name}") | ||
remoteLineSuffix.set("#L") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
plugins { | ||
id("lib-conventions-without-publishing") | ||
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions") | ||
} | ||
id("dokka-convention") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# for Dokka | ||
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> | ||
<meta charset="UTF-8"> | ||
<title>Compose HTML Material</title> | ||
<meta content="width=device-width, initial-scale=1" name="viewport"> | ||
<style> | ||
body { | ||
margin: 0; | ||
height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ul> | ||
<li><a href="api-documentation/index.html">API documentation</a></li> | ||
<li> | ||
<a href="https://huanshankeji.github.io/compose-multiplatform-material/"> | ||
Compose Multiplatform Material side-by-side demo | ||
</a> | ||
</li> | ||
</ul> | ||
</body> | ||
|
||
</html> |