Skip to content

set version to 8.0.0 #69

set version to 8.0.0

set version to 8.0.0 #69

name: Publish to GitHub Pages with Lunr Search Extension
on:
push:
branches:
- main
- 'v[0-9]*.[0-9]*.[0-9]*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: github-pages
cancel-in-progress: false
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: 'Build Doc Site'
services:
kroki:
image: yuzutech/kroki
ports:
- 8081:8000
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all branches
run: |
git fetch --all
for branch in $(git branch -r | grep -v '\->' | grep -v 'HEAD'); do
git branch --track "${branch#origin/}" "$branch" 2>/dev/null || true
done
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install Antora + Antora Lunr Extension + Kroki
run: npm i antora @antora/lunr-extension asciidoctor-kroki
- name: Wait for Kroki server to start # Optional but recommended
run: |
max_attempts=10
attempt=0
while [[ $attempt -lt $max_attempts ]]; do
curl -s http://localhost:8081/health | grep -q 'pass' && break || ((attempt++)) && sleep 1
done
- name: Generate Site
env:
KROKI_URL: http://localhost:8081
run: npx antora antora-playbook.yml
- name: Copy CNAME for custom domain
run: cp CNAME site/
- name: Copy schemas to clean URLs
run: |
mkdir -p site/schema
# Find all schema files and copy to clean paths like /schema/cj-1.2.3.json
find site/connected-json -name 'cj-schema.json' | while read schema; do
# Extract version from path (e.g., site/connected-json/1.2.3/_attachments/...)
version=$(echo "$schema" | sed -n 's|site/connected-json/\([0-9][^/]*\)/_attachments/.*|\1|p')
if [ -n "$version" ]; then
cp "$schema" "site/schema/cj-${version}.json"
echo "Copied $schema -> site/schema/cj-${version}.json"
fi
done
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
name: 'Deploy to GitHub Pages'
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4