Skip to content

Commit e4a023f

Browse files
Revert "Update Antora Plugin to 1.0.0"
This reverts commit 280f311.
1 parent e8837c8 commit e4a023f

19 files changed

+258
-507
lines changed

.github/actions/algolia-config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"index_name": "session-docs",
3+
"start_urls": [
4+
"https://docs.spring.io/spring-session/reference/"
5+
],
6+
"selectors": {
7+
"lvl0": {
8+
"selector": "//nav[@class='crumbs']//li[@class='crumb'][last()-1]",
9+
"type": "xpath",
10+
"global": true,
11+
"default_value": "Home"
12+
},
13+
"lvl1": ".doc h1",
14+
"lvl2": ".doc h2",
15+
"lvl3": ".doc h3",
16+
"lvl4": ".doc h4",
17+
"text": ".doc p, .doc td.content, .doc th.tableblock"
18+
}
19+
}
20+

.github/actions/algolia-deploy.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
HOST="$1"
4+
HOST_PATH="$2"
5+
SSH_PRIVATE_KEY="$3"
6+
SSH_KNOWN_HOST="$4"
7+
8+
9+
if [ "$#" -ne 4 ]; then
10+
echo -e "not enough arguments USAGE:\n\n$0 \$HOST \$HOST_PATH \$SSH_PRIVATE_KEY \$SSH_KNOWN_HOSTS \n\n" >&2
11+
exit 1
12+
fi
13+
14+
# Use a non-default path to avoid overriding when testing locally
15+
SSH_PRIVATE_KEY_PATH=~/.ssh/github-actions-docs
16+
install -m 600 -D /dev/null "$SSH_PRIVATE_KEY_PATH"
17+
echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVATE_KEY_PATH"
18+
echo "$SSH_KNOWN_HOST" > ~/.ssh/known_hosts
19+
rsync --delete -avze "ssh -i $SSH_PRIVATE_KEY_PATH" spring-session-docs/build/site/ "$HOST:$HOST_PATH"
20+
rm -f "$SSH_PRIVATE_KEY_PATH"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
###
4+
# Docs
5+
# config.json https://docsearch.algolia.com/docs/config-file
6+
# Run the crawler https://docsearch.algolia.com/docs/run-your-own/#run-the-crawl-from-the-docker-image
7+
8+
### USAGE
9+
if [ "$#" -ne 3 ]; then
10+
echo -e "not enough arguments USAGE:\n\n$0 \$ALGOLIA_APPLICATION_ID \$ALGOLIA_API_KEY \$CONFIG_FILE\n\n" >&2
11+
exit 1
12+
fi
13+
14+
# Script Parameters
15+
APPLICATION_ID=$1
16+
API_KEY=$2
17+
CONFIG_FILE=$3
18+
19+
#### Script
20+
script_dir=$(dirname $0)
21+
docker run -e "APPLICATION_ID=$APPLICATION_ID" -e "API_KEY=$API_KEY" -e "CONFIG=$(cat $CONFIG_FILE | jq -r tostring)" algolia/docsearch-scraper

.github/actions/dispatch.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
REPOSITORY_REF="$1"
2+
TOKEN="$2"
3+
4+
curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${TOKEN}" --request POST --data '{"event_type": "request-build-reference"}' https://api.github.com/repos/${REPOSITORY_REF}/dispatches
5+
echo "Requested Build for $REPOSITORY_REF"

.github/workflows/algolia-index.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Update Algolia Index
2+
3+
on:
4+
schedule:
5+
- cron: '0 10 * * *' # Once per day at 10am UTC
6+
workflow_dispatch: # Manual trigger
7+
8+
jobs:
9+
update:
10+
name: Update Algolia Index
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Source
14+
uses: actions/checkout@v2
15+
- name: Update Index
16+
run: ${GITHUB_WORKSPACE}/.github/actions/algolia-docsearch-scraper.sh "${{ secrets.ALGOLIA_APPLICATION_ID }}" "${{ secrets.ALGOLIA_WRITE_API_KEY }}" "${GITHUB_WORKSPACE}/.github/actions/algolia-config.json"

.github/workflows/antora-generate.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Generate Antora Files and Request Build
2+
3+
on:
4+
workflow_dispatch: # Manual trigger
5+
push:
6+
branches-ignore:
7+
- 'gh-pages'
8+
9+
env:
10+
GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Source
17+
uses: actions/checkout@v2
18+
- name: Generate antora.yml
19+
run: ./gradlew :spring-session-docs:generateAntora
20+
- name: Extract Branch Name
21+
id: extract_branch_name
22+
run: echo "##[set-output name=generated_branch_name;]$(echo ${GITHUB_REPOSITORY}/${GITHUB_REF##*/})"
23+
- name: Push generated antora files to the spring-generated-docs
24+
uses: JamesIves/[email protected]
25+
with:
26+
branch: ${{ steps.extract_branch_name.outputs.generated_branch_name }} # The branch the action should deploy to.
27+
folder: "spring-session-docs/build/generateAntora" # The folder the action should deploy.
28+
repository-name: "spring-io/spring-generated-docs"
29+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
30+
- name: Dispatch Build Request
31+
run: ${GITHUB_WORKSPACE}/.github/actions/dispatch.sh 'spring-projects/spring-session' "$GH_ACTIONS_REPO_TOKEN"

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build & Deploy Reference
2+
3+
on:
4+
repository_dispatch:
5+
types: request-build-reference
6+
schedule:
7+
- cron: '0 10 * * *' # Once per day at 10am UTC
8+
workflow_dispatch: # Manual trigger
9+
10+
jobs:
11+
deploy:
12+
name: deploy
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: '11'
20+
distribution: 'adopt'
21+
cache: gradle
22+
- name: Validate Gradle wrapper
23+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
24+
- name: Build with Gradle
25+
run: ./gradlew :spring-session-docs:antora --stacktrace
26+
- name: Cleanup Gradle Cache
27+
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
28+
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
29+
run: |
30+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
31+
rm -f ~/.gradle/caches/modules-2/gc.properties
32+
- name: Deploy
33+
run: ${GITHUB_WORKSPACE}/.github/actions/algolia-deploy.sh "${{ secrets.DOCS_USERNAME }}@${{ secrets.DOCS_HOST }}" "/opt/www/domains/spring.io/docs/htdocs/spring-session/reference/" "${{ secrets.DOCS_SSH_KEY }}" "${{ secrets.DOCS_SSH_HOST_KEY }}"

.github/workflows/rebuild-search-index.yml

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

buildSrc/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ sourceSets {
2626

2727
gradlePlugin {
2828
plugins {
29-
checkAntoraVersion {
30-
id = "org.springframework.antora.check-version"
31-
implementationClass = "org.springframework.gradle.antora.AntoraVersionPlugin"
32-
}
3329
managementConfiguration {
3430
id = "io.spring.convention.management-configuration"
3531
implementationClass = "io.spring.gradle.convention.ManagementConfigurationPlugin"
@@ -58,7 +54,6 @@ configurations {
5854
dependencies {
5955
implementation 'com.google.code.gson:gson:2.8.8'
6056
implementation 'net.sourceforge.saxon:saxon:9.1.0.8'
61-
implementation 'org.yaml:snakeyaml:1.30'
6257
implementation localGroovy()
6358

6459
implementation 'io.github.gradle-nexus:publish-plugin:1.1.0'

0 commit comments

Comments
 (0)