Skip to content

Build and Deploy Documentation (main) #170

Build and Deploy Documentation (main)

Build and Deploy Documentation (main) #170

Workflow file for this run

name: Build and Deploy Documentation
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., 1.0.x).
required: false
build-version:
description: Enter the version being build (e.g. 1.0.3-SNAPSHOT)
required: false
push:
branches: docs-build
permissions: read-all
jobs:
build-and-deploy-docs:
name: Build and Deploy Documentation
if: github.repository_owner == 'spring-projects'
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Main Branch
run: git fetch origin main:main
- name: Set Up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Check Out 'package.json' From Main
run: node run.js --only-checkout
- name: Cache Files
uses: actions/cache@v4
with:
key: antora-${{ hashFiles('package-lock.json', 'antora-playbook.yml') }}
path: |
~/.npm
~/.cache/antora
- name: Install and Run Antora
env:
ALGOLIA_APP_ID: 'WB1FQYI187'
ALGOLIA_API_KEY: '9d489079e5ec46dbb238909fee5c9c29'
ALGOLIA_INDEX_NAME: 'springdocs'
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
REFERENCE: ${{ github.event.inputs.build-refname }}
BUILD_VERSION: ${{ github.event.inputs.build-version }}
run: node run.js --no-checkout
- name: Sync Documentation
uses: spring-io/spring-doc-actions/rsync-antora-reference@v0.0.16
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 }}
httpdocs-path: /spring-boot/antora/reference
- name: Bust Cloudflare Cache
uses: spring-io/spring-doc-actions/bust-cloudflare-antora-cache@v0.0.16
with:
context-root: spring-boot
context-path: /
cloudflare-zone-id: ${{ secrets.CLOUDFLARE_ZONE_ID }}
cloudflare-cache-token: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}