Enable GitHub pages

Before publishing documentation you must enable pages support for your repository We ll use actions to build and publish static documentation Go to your project settings Navigate to the Pages section In Source section change source to GitHub actions

Set up the pipeline

Create an action file in Use the following example to build and deploy your pages Warning Make sure you changed the path in step It must be set to your repository name github workflows znai pages deploy yml name Publish Documentation on push branches main # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions contents read pages write id token write jobs build runs on ubuntu latest steps uses actions checkout@v5 run git fetch prune unshallow # Set up java and maven name Set up JDK 17 uses actions setup java@v5 with distribution temurin java version 17 java package jdk # You ll need graphviz if you re generating diagrams name Set up graphviz run sudo apt get install graphviz # Use virtual frame buffer to render images name Build with xvfb enabled uses GabrielBB xvfb action@v1 7 # build documentation using maven with run mvn B f docs pom xml znai build # Prepare pages for your repository name Setup Pages uses actions configure pages@v5 # Create pages artifact Change `path` to `docs target <your project name> name Upload artifact uses actions upload pages artifact@v4 with # Change `path` to `docs target <your project name> path docs target znai rust showcase # Publish artifact on GitHub pages name Deploy to GitHub Pages id deployment uses actions deploy pages@v4 Upload artifact name Upload artifact uses actions upload pages artifact@v4 with # Change `path` to `docs target <your project name> path docs target znai rust showcase

Checking documentation

Make changes in documentation Commit and push your changes Go to the Actions tab of your repository Wait for Publish Documentation job to finish After that navigate to the GitHub pages of your project