Skip to content

Commit

Permalink
fixing documentation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vondacho committed May 5, 2023
1 parent 4ffd2d4 commit aed262d
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 52 deletions.
6 changes: 1 addition & 5 deletions .github/actions/mkdocs-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ runs:
with:
python-version: 3.x

- shell: bash
run: |
pip install mkdocs mkdocs-material
- name: Deploy to GH pages
shell: bash
run: |
mkdocs gh-deploy --force --clean --verbose
mkdocs gh-deploy --config-file src/doc/mkdocs.yml --force --clean --verbose
4 changes: 2 additions & 2 deletions .github/scripts/setup-gradle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IFS=$'\n\t'

cat <<EOF >> gradle-local.properties
githubUsername=$GITHUB_USERNAME
githubToken=$GITHUB_TOKEN
org.ajoberstar.grgit.auth.username=$GITHUB_USERNAME
org.ajoberstar.grgit.auth.password=$GITHUB_TOKEN
EOF
13 changes: 9 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ jobs:
- name: Build main branch
run: ./gradlew -Pversion=${{ steps.release.outputs.version }} build

- name: Build documentation
run: ./gradlew mkdocs
- name: Prepare documentation
run: ./gradlew allureAggregateReport plantumlAll generateSwaggerUI

- name: Publish documentation
uses: ./.github/actions/mkdocs-publish
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Build and publish documentation to GH pages
run: ./gradlew -Pversion=${{ steps.release.outputs.version }} mkdocsPublish
71 changes: 36 additions & 35 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.freefair.gradle.plugins.mkdocs.tasks.MkDocs
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.springframework.cloud.contract.verifier.config.TestMode
import ru.vyarus.gradle.plugin.python.PythonExtension

plugins {
id("java")
Expand All @@ -13,7 +13,8 @@ plugins {
id("com.appland.appmap") version "1.1.1"
id("org.hidetake.swagger.generator") version "2.19.2"
id("io.github.redgreencoding.plantuml") version "0.2.0"
id("io.freefair.mkdocs") version "8.0.1"
id("ru.vyarus.mkdocs") version "3.0.0"
id("net.saliman.properties") version "1.5.2"
}

java {
Expand Down Expand Up @@ -125,7 +126,7 @@ allure {
}

appmap {
configFile.set(file("$projectDir/appmap.yml"))
configFile.set(file("$projectDir/src/doc/appmap.yml"))
outputDirectory.set(file("$buildDir/appmap"))
isSkip = false
debug = "info"
Expand All @@ -145,13 +146,40 @@ plantuml {
}
diagrams {
create("hexagonal") {
sourceFile = project.file("doc/uml/hexagonal.puml")
sourceFile = project.file("src/doc/uml/hexagonal.puml")
}
create("domain") {
sourceFile = project.file("doc/uml/domain-model.puml")
create("domain-model") {
sourceFile = project.file("src/doc/uml/domain-model.puml")
}
create("data") {
sourceFile = project.file("doc/uml/data-model.puml")
create("data-model") {
sourceFile = project.file("src/doc/uml/data-model.puml")
}
}
}

python {
scope = PythonExtension.Scope.USER
}

mkdocs {
strict = false
updateSiteUrl = false
sourcesDir = "src/doc"
buildDir = "build/mkdocs"
publish.docPath = "$version".ifEmpty { "snapshot" }
}

gitPublish {
contents {
from("${mkdocs.buildDir}")
from("build/reports/tests") {
into("${mkdocs.publish.docPath}/reports/tests")
}
from("build/plantuml") {
into("${mkdocs.publish.docPath}/uml")
}
from("build/swagger-ui-apidoc") {
into("${mkdocs.publish.docPath}/api")
}
}
}
Expand Down Expand Up @@ -191,31 +219,4 @@ tasks {
check {
dependsOn(acceptanceTest)
}
named<MkDocs>("mkdocs") {
dependsOn("allureAggregateReport")
//dependsOn("plantumlAll")
dependsOn("generateSwaggerUI")
doLast {
copy {
from("build/reports/tests")
into("build/docs/mkdocs/reports/tests")
}
copy {
from("build/reports/allure-report/allureAggregateReport")
into("build/docs/mkdocs/reports/tests/allure")
}
copy {
from("build/plantuml")
into("build/docs/mkdocs/uml")
}
copy {
from("build/appmap")
into("build/docs/mkdocs/appmap")
}
copy {
from("build/swagger-ui-apidoc")
into("build/docs/mkdocs/api")
}
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.ajoberstar.grgit.auth.username=changeme
org.ajoberstar.grgit.auth.password=changeme
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mkdocs.yml → src/doc/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
docs_dir: tech

site_name: arch-blueprint-java
site_url: https://vondacho.github.io/arch-blueprint-java
site_dir: build/docs/mkdocs
repo_url: https://github.com/vondacho/arch-blueprint-java/
repo_name: GitHub repository
docs_dir: doc/tech

nav:
- Home: index.md
Expand Down
6 changes: 3 additions & 3 deletions doc/tech/architecture.md → src/doc/tech/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
- [Component view](https://www.structurizr.com/share/38199/diagrams#blueprint-api-components)

## AppMap
- [App maps](../appmap/junit)
- To install the AppMap extension in your IDE
- To build the app maps with `./gradlew appmap test`
- To visualize the app maps using the AppMap extension

## Hexagonal
The logical layers are organized like an onion with the domain layer at the center.
Expand All @@ -21,10 +21,10 @@ ACL is used to protect the internal ubiquitous language from external languages.
![Domain model](../uml/hexagonal.svg)

## Domain model
![Domain model](../uml/domain.svg)
![Domain model](../uml/domain-model.svg)

## Data model
![Data model](../uml/data.svg)
![Data model](../uml/data-model.svg)

## CI/CD
[Github actions](https://github.com/vondacho/arch-blueprint-java/actions)
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion doc/tech/testing.md → src/doc/tech/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ To launch the contract tests with `./gradlew contractTest`
- [Acceptance test](../reports/tests/acceptanceTest)
- [Contract tests](../reports/tests/contractTest)
- [Unit and integration tests](../reports/tests/test)
- [Allure](../reports/tests/allure)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit aed262d

Please sign in to comment.