Skip to content

Commit b5aef9f

Browse files
committed
chore: remove release-docs workflow
This workflow is useless in such form because calling it on a -SNAPSHOT version would publish docs with such version. In practice, I publish a patch version to update just the docs, and 99% of the times, the changes in the docs can wait for the next scheduled release. Removing this workflow simplifies our GitHub scripts.
1 parent 1a493c9 commit b5aef9f

File tree

4 files changed

+36
-139
lines changed

4 files changed

+36
-139
lines changed

.github/workflows/release-common.main.kts

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release-docs.main.kts

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release-docs.yaml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/release.main.kts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
@file:Repository("https://bindings.krzeminski.it")
66
@file:DependsOn("actions:checkout:v4")
77
@file:DependsOn("gradle:actions__setup-gradle:v3")
8+
@file:DependsOn("JamesIves:github-pages-deploy-action:v4")
89

910
@file:Import("_shared.main.kts")
10-
@file:Import("release-common.main.kts")
1111
@file:Import("setup-java.main.kts")
1212
@file:Import("setup-python.main.kts")
1313

1414
import io.github.typesafegithub.workflows.actions.actions.Checkout
1515
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
16+
import io.github.typesafegithub.workflows.actions.jamesives.GithubPagesDeployAction
1617
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
1718
import io.github.typesafegithub.workflows.domain.triggers.Push
19+
import io.github.typesafegithub.workflows.dsl.JobBuilder
1820
import io.github.typesafegithub.workflows.dsl.expressions.expr
1921
import io.github.typesafegithub.workflows.dsl.workflow
2022

@@ -62,3 +64,36 @@ workflow(
6264
deployDocs()
6365
}
6466
}
67+
68+
private fun JobBuilder<*>.deployDocs() {
69+
run(command = "pip install -r docs/requirements.txt")
70+
71+
val directoryToDeploy = "to-gh-pages"
72+
run(
73+
name = "Build Mkdocs docs",
74+
command = "mkdocs build --site-dir $directoryToDeploy",
75+
)
76+
uses(action = ActionsSetupGradle())
77+
run(
78+
name = "Generate API docs",
79+
command = "./gradlew :github-workflows-kt:dokkaHtml --no-configuration-cache",
80+
)
81+
run(
82+
name = "Prepare target directory for API docs",
83+
command = "mkdir -p $directoryToDeploy/api-docs",
84+
)
85+
run(
86+
name = "Copy Dokka output to Mkdocs output",
87+
command = "cp -r github-workflows-kt/build/dokka/html/* $directoryToDeploy/api-docs",
88+
)
89+
run(
90+
name = "Copy teaser image",
91+
command = "cp images/teaser-with-newest-version.svg $directoryToDeploy"
92+
)
93+
uses(
94+
name = "Deploy merged docs to GitHub Pages",
95+
action = GithubPagesDeployAction(
96+
folder = "$directoryToDeploy",
97+
),
98+
)
99+
}

0 commit comments

Comments
 (0)