From 9ea93f3d8deae5f41a476c0219c1cbb70d6c1420 Mon Sep 17 00:00:00 2001 From: Nicolai Ommer Date: Fri, 12 Dec 2025 14:42:50 +0100 Subject: [PATCH] ci: Add a separate check workflow --- .github/workflows/build-antora.yml | 66 ++++++++++++++++++++++++++++++ .github/workflows/check.yml | 16 ++++++++ .github/workflows/deploy-docs.yml | 58 ++++++++++---------------- 3 files changed, 103 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/build-antora.yml create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/build-antora.yml b/.github/workflows/build-antora.yml new file mode 100644 index 0000000..18d387b --- /dev/null +++ b/.github/workflows/build-antora.yml @@ -0,0 +1,66 @@ +# Reusable Workflow: Build Antora Documentation Site +# This workflow can be called from other workflows to build the Antora site. +# Includes Kroki/Mermaid services for diagram rendering. + +name: Build Antora Site + +on: + workflow_call: + inputs: + node-version: + description: 'Node.js version to use' + required: false + type: string + default: '24.3.0' + playbook-file: + description: 'Path to Antora playbook file' + required: false + type: string + default: 'antora-playbook.yml' + outputs: + build-path: + description: 'Path to the built site directory' + value: 'build/site' + +jobs: + build: + runs-on: ubuntu-latest + + services: + mermaid: + image: yuzutech/kroki-mermaid:latest + ports: + - 8002:8002 + kroki: + image: yuzutech/kroki:latest + env: + KROKI_MERMAID_HOST: mermaid + ports: + - 8000:8000 + options: >- + --health-cmd "curl -f http://localhost:8000/health || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Checkout playbook source + uses: actions/checkout@v5 + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: ${{ inputs.node-version }} + + - name: Install Antora and Dependencies + run: npm install + + - name: Generate Site + run: npx antora generate --log-failure-level warn ${{ inputs.playbook-file }} + + - name: Upload built site + uses: actions/upload-artifact@v4 + with: + name: antora-site + path: build/site + retention-days: 1 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..d4e5223 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,16 @@ +# GitHub Actions Workflow: Check Antora Documentation Build +# Validates that the documentation site builds successfully on PRs and Renovate branches. +# Does not deploy - only verifies the build works. + +name: Check Antora Build + +on: + pull_request: + push: + branches: + - 'renovate/**' + +jobs: + check: + name: Build documentation site + uses: ./.github/workflows/build-antora.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 7ca43b0..64bb4ab 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,52 +1,36 @@ -# GitHub Actions Workflow: Build and Deploy Antora Documentation -# Automatically builds documentation site from multiple repositories and deploys to GitHub Pages. +# GitHub Actions Workflow: Deploy Antora Documentation +# Builds documentation site and deploys to GitHub Pages. +# Runs on pushes to main, scheduled runs, and manual triggers. + +name: Deploy Antora Docs -name: Build and Deploy Antora Docs on: push: - branches: [main] # Auto-deploy on main branch updates - workflow_dispatch: # Manual trigger option + branches: + - main + workflow_dispatch: schedule: - cron: '0 2 * * *' # Run daily at 2 AM UTC jobs: - build-and-deploy: + build: + name: Build documentation site + uses: ./.github/workflows/build-antora.yml + + deploy: + name: Deploy to GitHub Pages + needs: build runs-on: ubuntu-latest permissions: - contents: write # Required to push to the gh-pages branch - - services: - mermaid: - image: yuzutech/kroki-mermaid:latest - ports: - - 8002:8002 - kroki: - image: yuzutech/kroki:latest - env: - KROKI_MERMAID_HOST: mermaid - ports: - - 8000:8000 - options: >- - --health-cmd "curl -f http://localhost:8000/health || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 + contents: write steps: - - name: Checkout playbook source - uses: actions/checkout@v5 - - - name: Setup Node.js - uses: actions/setup-node@v5 + - name: Download built site + uses: actions/download-artifact@v4 with: - node-version: '24.3.0' # Specific version for consistency - - - name: Install Antora and Dependencies - run: npm install - - - name: Generate Site - run: npx antora generate --log-failure-level warn antora-playbook.yml + name: antora-site + path: build/site - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 @@ -55,4 +39,4 @@ jobs: publish_dir: build/site cname: docs.agentic-layer.ai user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' \ No newline at end of file + user_email: 'github-actions[bot]@users.noreply.github.com'