Files
Basalt2/.github/workflows/docs.yml
Robert Jelic 534226e792 Test
2025-02-09 18:50:50 +01:00

55 lines
1.5 KiB
YAML

# Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
name: Build Docs
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Lua
uses: leafo/gh-actions-lua@v8
with:
luaVersion: 5.4
- name: Setup Lua Rocks
uses: leafo/gh-actions-luarocks@v4
- name: Setup dependencies
run: luarocks install ldoc
- name: Build docs
run: |
rm -rf out
mkdir -p out
echo "Running LDoc..."
ldoc . --dir out --ext md --verbose
echo "Looking for generated files..."
find . -maxdepth 1 -type f -name "*.md"
echo "Moving relevant files to out directory..."
find . -maxdepth 1 -type f -name "*.md" -exec mv {} out/ \;
# Cleanup - remove LDoc test files
rm -f out/one.md out/two.md out/opt.md
echo "Final output directory contents:"
ls -la out/
if [ -z "$(ls -A out/)" ]; then
echo "Error: No documentation files were generated!"
exit 1
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
force_orphan: true # Start with a fresh branch each time
commit_message: "docs: update documentation [skip ci]"