Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Docs

# Render the AsciiDoc user guide and publish it to GitHub Pages.
# The live site is served from whichever repo has Pages enabled:
# - fork: https://rigazilla.github.io/cpp17-client/
# - upstream: https://infinispan.github.io/cpp17-client/ (once a maintainer enables Pages)
#
# Builds run on every push/PR that touches the docs so breakage is caught early;
# deployment happens only on push to `main`.

on:
push:
branches: [ main ]
paths:
- 'documentation/**'
- 'scripts/build-docs.sh'
- '.github/workflows/docs.yml'
pull_request:
branches: [ main ]
paths:
- 'documentation/**'
- 'scripts/build-docs.sh'
- '.github/workflows/docs.yml'
workflow_dispatch:

# Allow one concurrent deployment; cancel in-progress runs of this workflow.
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'

- name: Install asciidoctor
run: gem install asciidoctor --no-document

- name: Render user guide
run: ./scripts/build-docs.sh

- name: Upload Pages artifact
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v3
with:
path: documentation/_build

deploy:
# Only publish from main; PR builds above just verify the render succeeds.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Build directories
build/
build-*/
build.saved/
cmake-build-*/
out/

# Rendered documentation (see scripts/build-docs.sh)
documentation/_build/

# Tooling output / local logs
graphify-out/
*.log
ctest.log.txt

# IDE files
.vscode/
.idea/
Expand Down
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,26 @@ else()
message(WARNING "Google Test not found - tests disabled")
endif()

# Documentation
# `cmake --build <dir> --target docs` renders the AsciiDoc user guide to
# documentation/_build/index.html. It just wraps scripts/build-docs.sh (the
# single source of truth, shared with CI), so it is a no-configure convenience,
# not part of the default build. Needs asciidoctor on PATH.
find_program(ASCIIDOCTOR_EXECUTABLE asciidoctor)
if(ASCIIDOCTOR_EXECUTABLE)
add_custom_target(docs
COMMAND ${CMAKE_COMMAND} -E env bash
${CMAKE_SOURCE_DIR}/scripts/build-docs.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Rendering user guide to documentation/_build/index.html"
VERBATIM
USES_TERMINAL
)
message(STATUS "asciidoctor found - 'docs' target enabled")
else()
message(STATUS "asciidoctor not found - 'docs' target disabled (gem install asciidoctor)")
endif()

# Installation
install(TARGETS hotrod-client
EXPORT hotrod-client-targets
Expand Down
Loading
Loading