Skip to content

Commit baa307a

Browse files
rwinchjvalkeal
authored andcommitted
Add Antora docs-build
1 parent 4810c65 commit baa307a

11 files changed

+504
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Docs
2+
run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build-refname:
7+
description: Enter git refname to build (e.g., 5.7.x).
8+
required: false
9+
push:
10+
branches: docs-build
11+
env:
12+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
13+
permissions: read-all
14+
jobs:
15+
build:
16+
if: github.repository_owner == 'spring-projects'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 5
23+
- name: Set Up Gradle
24+
uses: spring-io/spring-gradle-build-action@v2
25+
with:
26+
java-version: '17'
27+
distribution: temurin
28+
- name: Set up refname build
29+
if: github.event.inputs.build-refname
30+
run: |
31+
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
32+
echo BUILD_REFNAME=${{ github.event.inputs.build-refname }} >> $GITHUB_ENV
33+
echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV
34+
- name: Run Antora
35+
run: ./gradlew antora
36+
- name: Copy the cache to be included in the site
37+
run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/
38+
- name: Publish Docs
39+
uses: spring-io/spring-doc-actions/[email protected]
40+
with:
41+
docs-username: ${{ secrets.DOCS_USERNAME }}
42+
docs-host: ${{ secrets.DOCS_HOST }}
43+
docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
44+
docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
45+
- name: Bust Clouflare Cache
46+
uses: spring-io/spring-doc-actions/[email protected]
47+
with:
48+
context-root: spring-shell
49+
cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
50+
cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/.gradle/
2+
/.idea/*
3+
/.settings/
4+
/.classpath
5+
/.project
6+
/build/
7+
/node_modules/
8+
/package-lock.json
9+
/*.iml
10+
/*.ipr
11+
/*.iws
12+
!/.idea/checkstyle-idea.xml
13+
!/.idea/externalDependencies.xml

.idea/checkstyle-idea.xml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
= Spring Shell Docs Build
2+
3+
You're currently viewing the Antora playbook branch.
4+
The playbook branch hosts the docs build that is used to build and publish the production docs site.
5+
6+
The Spring Shell reference docs are built using https://antora.org[Antora].
7+
This README covers how to build the docs in a software branch as well as how to build the production docs site locally.
8+
9+
== Building the Site
10+
11+
You can build the entire site by invoking the following and then viewing the site at `build/site/index.html`
12+
13+
[source,bash]
14+
----
15+
./gradlew antora
16+
----
17+
18+
== Building a Specific Branch
19+
20+
You can build a specific branch and then viewing the branch specific site at `build/site/index.html`.
21+
22+
[source,bash]
23+
----
24+
./gradlew antora
25+
----

antora-playbook.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
antora:
2+
extensions:
3+
- '@springio/antora-extensions/partial-build-extension'
4+
- require: '@springio/antora-extensions/latest-version-extension'
5+
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
6+
- '@antora/collector-extension'
7+
- '@antora/atlas-extension'
8+
- require: '@springio/antora-extensions/root-component-extension'
9+
root_component_name: 'shell'
10+
site:
11+
title: Spring Shell
12+
url: https://docs.spring.io/spring-shell/reference
13+
robots: allow
14+
git:
15+
ensure_git_suffix: false
16+
content:
17+
sources:
18+
- url: https://github.com/spring-projects/spring-shell
19+
# Refname matching:
20+
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
21+
branches: [ main,'({3..9}).+({0..9}).x', '!(3.{0..1}.x)' ]
22+
tags: [ 'v({3..9}).+({0..9}).+({0..9})?(-{RC,M}+({0..9}))', '!(v3.{0..1}.+({0..9})?(-{RC,M}+({0..9})))' ]
23+
start_path: spring-shell-docs
24+
asciidoc:
25+
attributes:
26+
page-stackoverflow-url: https://stackoverflow.com/tags/spring-shell
27+
page-pagination: ''
28+
hide-uri-scheme: '@'
29+
tabs-sync-option: '@'
30+
extensions:
31+
- '@asciidoctor/tabs'
32+
- '@springio/asciidoctor-extensions'
33+
urls:
34+
latest_version_segment_strategy: redirect:to
35+
latest_version_segment: ''
36+
redirect_facility: httpd
37+
ui:
38+
bundle:
39+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.3/ui-bundle.zip
40+
runtime:
41+
log:
42+
failure_level: warn

build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id 'base'
3+
id 'org.antora' version '1.0.0'
4+
}
5+
6+
antora {
7+
version = '3.2.0-alpha.2'
8+
options = [clean: true, fetch: true, stacktrace: true]
9+
environment = [
10+
'ALGOLIA_API_KEY': '9d489079e5ec46dbb238909fee5c9c29',
11+
'ALGOLIA_APP_ID': 'WB1FQYI187',
12+
'ALGOLIA_INDEX_NAME': 'springshell',
13+
]
14+
dependencies = [
15+
'@antora/atlas-extension': '1.0.0-alpha.1',
16+
'@antora/collector-extension': '1.0.0-alpha.3',
17+
'@asciidoctor/tabs': '1.0.0-beta.3',
18+
'@springio/antora-extensions': '1.4.2',
19+
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
20+
]
21+
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group=org.springframework.shell
2+
description=Spring GraphQL Docs Site

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)