This commit is contained in:
Robert Jelic
2025-02-09 16:44:32 +01:00
parent a019e5682c
commit a7242d08c0
3 changed files with 25 additions and 67 deletions

View File

@@ -1,65 +1,30 @@
name: Generate Documentation name: Build Docs
on: on:
push:
branches:
- main
paths:
- 'src/**'
- '**.lua'
pull_request: pull_request:
branches: branches:
- main - master
paths: push:
- 'src/**' branches:
- '**.lua' - master
jobs: jobs:
docs: build:
name: Build docs
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Setup Lua
- name: Install Lua and LDoc uses: leafo/gh-actions-lua@v8
run: | with:
sudo apt-get update luaVersion: 5.4
sudo apt-get install -y lua5.3 \ - name: Setup Lua Rocks
lua5.3-dev \ uses: leafo/gh-actions-luarocks@v4
liblua5.3-dev \ - name: Setup dependencies
luarocks \ run: luarocks install --only-deps ldoc-dev-1.rockspec
build-essential \ - name: Build docs
libreadline-dev run: make doc-site
- name: Deploy
sudo luarocks --lua-version=5.3 install ldoc if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
ldoc --version || exit 1 with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Documentation
run: |
echo "Checking config.ld location:"
pwd
ls -la config.ld || echo "config.ld not found in current directory"
echo "Available Lua-Files:"
find src -name "*.lua" -type f
echo "Running LDoc with explicit config path..."
ldoc . -c config.ld --verbose
if [ ! -d "docs" ]; then
echo "Documentation generation failed"
exit 1
fi
- name: Commit documentation
if: success()
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/
git commit -m 'Update documentation'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,11 +6,5 @@ dir = 'docs'
file = {'src'} file = {'src'}
style = '!pale' style = '!pale'
sort = true sort = true
not_luadoc = true
all = true all = true
no_space_before_args = true topics = {'README.md'}
wrap = true
one = true -- Generiere eine Datei pro Modul
recurse = true -- Rekursiv durch Unterverzeichnisse gehen
shallow = true -- Behalte Verzeichnisstruktur bei
kind_names = {module = 'Modules', topic = 'Topics'}

View File

@@ -186,6 +186,5 @@ function basalt.run(isActive)
end end
end end
end end
basalt.autoUpdate = basalt.run
return basalt return basalt