Skip to content

Commit

Permalink
Initial Antora docs-build branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rwinch authored Dec 5, 2023
1 parent a7c8eba commit 985032a
Show file tree
Hide file tree
Showing 11 changed files with 498 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy Docs
run-name: ${{ format('{0} ({1})', github.workflow, github.event.inputs.build-refname || 'all') }}
on:
workflow_dispatch:
inputs:
build-refname:
description: Enter git refname to build (e.g., 5.7.x).
required: false
push:
branches: docs-build
env:
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
permissions: read-all
jobs:
build:
if: github.repository_owner == 'spring-projects'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Set Up Gradle
uses: spring-io/spring-gradle-build-action@v2
with:
java-version: '17'
distribution: temurin
- name: Set up refname build
if: github.event.inputs.build-refname
run: |
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
echo BUILD_REFNAME=${{ github.event.inputs.build-refname }} >> $GITHUB_ENV
echo BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:gradle.properties | sed -n '/^version=/ { s/^version=//;p }') >> $GITHUB_ENV
- name: Run Antora
run: ./gradlew antora
- name: Copy the cache to be included in the site
run: cp -rf build/antora/inject-collector-cache-config-extension/.cache build/site/
- name: Publish Docs
uses: spring-io/spring-doc-actions/[email protected]
with:
docs-username: ${{ secrets.DOCS_USERNAME }}
docs-host: ${{ secrets.DOCS_HOST }}
docs-ssh-key: ${{ secrets.DOCS_SSH_KEY }}
docs-ssh-host-key: ${{ secrets.DOCS_SSH_HOST_KEY }}
- name: Bust Clouflare Cache
uses: spring-io/spring-doc-actions/[email protected]
with:
context-root: spring-amqp
cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/.gradle/
/.idea/*
/.settings/
/.classpath
/.project
/build/
/node_modules/
/package-lock.json
/*.iml
/*.ipr
/*.iws
!/.idea/checkstyle-idea.xml
!/.idea/externalDependencies.xml
6 changes: 6 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Use sdkman to run "sdk env" to initialize with correct JDK version
# Enable auto-env through the sdkman_auto_env config
# See https://sdkman.io/usage#config
# A summary is to add the following to ~/.sdkman/etc/config
# sdkman_auto_env=true
java=17.0.9-tem
25 changes: 25 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
= Spring AMQP Docs Build

You're currently viewing the Antora playbook branch.
The playbook branch hosts the docs build that is used to build and publish the production docs site.

The Spring AMQP reference docs are built using https://antora.org[Antora].
This README covers how to build the docs in a software branch as well as how to build the production docs site locally.

== Building the Site

You can build the entire site by invoking the following and then viewing the site at `build/site/index.html`

[source,bash]
----
./gradlew antora
----

== Building a Specific Branch

You can build a specific branch and then viewing the branch specific site at `build/site/index.html`.

[source,bash]
----
./gradlew antora
----
44 changes: 44 additions & 0 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
antora:
extensions:
- '@springio/antora-extensions/partial-build-extension'
- require: '@springio/antora-extensions/latest-version-extension'
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
- '@antora/collector-extension'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: 'amqp'
- '@springio/antora-extensions/static-page-extension'
site:
title: Spring AMQP
url: https://docs.spring.io/spring-amqp/reference
robots: allow
git:
ensure_git_suffix: false
content:
sources:
- url: https://github.com/spring-projects/spring-amqp
# Refname matching:
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
branches: [ main,'({3..9}).+({0..9}).x', '!(3.0.x)' ]
tags: [ 'v({3..9}).+({0..9}).+({0..9})?(-{RC,M}+({0..9}))', '!(v3.0.*)', '!(v3.1.0?(-{RC,M}+({0..9})))']
start_path: src/reference/antora
asciidoc:
attributes:
page-stackoverflow-url: https://stackoverflow.com/tags/spring-amqp
page-related-doc-projects: integration,framework
hide-uri-scheme: '@'
tabs-sync-option: '@'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
urls:
latest_version_segment_strategy: redirect:to
latest_version_segment: ''
redirect_facility: httpd
ui:
bundle:
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.9/ui-bundle.zip
snapshot: true
runtime:
log:
failure_level: warn
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'base'
id 'org.antora' version '1.0.0'
}

antora {
version = '3.2.0-alpha.2'
options = [clean: true, fetch: true, stacktrace: true]
environment = [
'ALGOLIA_API_KEY': '9d489079e5ec46dbb238909fee5c9c29',
'ALGOLIA_APP_ID': 'WB1FQYI187',
'ALGOLIA_INDEX_NAME': 'springdocs',
]
// NOTE remember to update the versions in lib/antora/templates/per-branch-antora-playbook.yml as well
dependencies = [
'@antora/atlas-extension': '1.0.0-alpha.1',
'@antora/collector-extension': '1.0.0-alpha.3',
'@asciidoctor/tabs': '1.0.0-beta.3',
'@springio/antora-extensions': '1.7.0',
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
]
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group=org.springframework.amqp
description=Spring AMQP Docs Site
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 985032a

Please sign in to comment.