Skip to content

Commit be27048

Browse files
rwinchjzheaux
authored andcommitted
Copy default antora files
1 parent d10069f commit be27048

File tree

4 files changed

+116
-19
lines changed

4 files changed

+116
-19
lines changed

.github/workflows/deploy-docs.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# FIXME enable when pushed to spring-projects
17+
# if: github.repository_owner == 'spring-projects'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs-build
23+
fetch-depth: 1
24+
- name: Dispatch (partial build)
25+
if: github.ref_type == 'branch'
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29+
- name: Dispatch (full build)
30+
if: github.ref_type == 'tag'
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

antora.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: ldap
2+
version: true
3+
title: Spring LDAP
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
run:
9+
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" generateAntoraYml
10+
local: true
11+
scan:
12+
dir: ./build/generated-antora-resources
13+
14+
asciidoc:
15+
attributes:
16+
attribute-missing: 'warn'
17+
# FIXME: the copyright is not removed
18+
# FIXME: The package is not renamed
19+
chomp: 'all'

build.gradle

+25-19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ buildscript {
1313
}
1414
}
1515

16+
plugins {
17+
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
18+
id 'org.antora' version '1.0.0'
19+
}
20+
1621
apply plugin: 'io.spring.convention.root'
1722
apply plugin: 'io.spring.convention.docs'
1823
apply plugin: 'io.spring.javaformat'
@@ -32,26 +37,27 @@ nohttp {
3237
source.exclude "buildSrc/build/**"
3338
}
3439

35-
asciidoctor {
36-
outputDir = new File("$buildDir/docs")
37-
attributes([
38-
copycss : '',
39-
icons : 'font',
40-
'source-highlighter': 'prettify',
41-
sectanchors : '',
42-
toc2: '',
43-
idprefix: '',
44-
idseparator: '-',
45-
doctype: 'book',
46-
numbered: '',
47-
'spring-ldap-version' : project.version,
48-
revnumber : project.version
49-
])
50-
options = [
51-
eruby: 'erubis'
52-
]
40+
41+
antora {
42+
playbook = 'cached-antora-playbook.yml'
43+
playbookProvider {
44+
repository = 'spring-projects/spring-ldap'
45+
branch = 'docs-build'
46+
path = 'lib/antora/templates/per-branch-antora-playbook.yml'
47+
checkLocalBranch = true
48+
}
49+
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
50+
}
51+
52+
53+
54+
tasks.named("generateAntoraYml") {
55+
asciidocAttributes = project.provider( {
56+
return ['project-version': project.version]
57+
} )
5358
}
5459

60+
5561
s101 {
5662
configurationDirectory = project.file("etc/s101")
5763
}
@@ -60,7 +66,7 @@ allprojects {
6066
if (!['spring-ldap-bom', 'spring-security-docs'].contains(project.name)) {
6167
apply plugin: 'io.spring.javaformat'
6268
apply plugin: 'checkstyle'
63-
69+
6470
pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
6571
configure(plugin) {
6672
dependencies {

cached-antora-playbook.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PACKAGES [email protected] @antora/atlas-extension:1.0.0-alpha.1 @antora/[email protected] @springio/[email protected] @asciidoctor/[email protected] @springio/asciidoctor-extensions @opendevise/[email protected]
2+
#
3+
# The purpose of this Antora playbook is to build the docs in the current branch.
4+
antora:
5+
extensions:
6+
- '@antora/collector-extension'
7+
- id: '@antora/atlas-extension'
8+
require: '@antora/atlas-extension'
9+
enabled: false
10+
- '@springio/antora-extensions/latest-version-extension'
11+
- require: '@springio/antora-extensions/root-component-extension'
12+
root_component_name: 'ldap'
13+
site:
14+
title: Spring LDAP Reference
15+
content:
16+
sources:
17+
- url: .
18+
branches: HEAD
19+
worktrees: true
20+
asciidoc:
21+
attributes:
22+
hide-uri-scheme: '@'
23+
page-pagination: ''
24+
primary-site-url: https://docs.spring.io/spring-ldap/reference
25+
tabs-sync-option: '@'
26+
extensions:
27+
- '@asciidoctor/tabs'
28+
- '@springio/asciidoctor-extensions'
29+
- '@springio/asciidoctor-extensions/include-code-extension'
30+
sourcemap: true
31+
urls:
32+
latest_version_segment: ''
33+
runtime:
34+
log:
35+
failure_level: warn
36+
ui:
37+
bundle:
38+
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
39+
snapshot: true

0 commit comments

Comments
 (0)