Merge pull request #61 from idbrii/automate-docs

Automate ldoc generation
This commit is contained in:
Colby Klein 2021-06-23 15:49:44 -07:00 committed by GitHub
commit 7a7e748430
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 1 deletions

31
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,31 @@
# Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
name: Documentation
on:
pull_request: # Build on pull requests to ensure they don't break docs.
branches:
- master
push: # We'll only push new docs when master is updated (see below).
branches:
- master
jobs:
build:
name: Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 and run ldoc
run: bash ./doc/install_and_build_docs
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/out

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
# LDoc generated files.
doc/doc
doc/out

View File

@ -7,3 +7,6 @@ file = {
"../init.lua",
"../modules"
}
dir='./out'
readme='../README.md'
style='!new'

View File

@ -0,0 +1,13 @@
#! /bin/sh
# on github, leafo/gh-actions-lua leafo/gh-actions-luarocks setup luarocks for us.
#~ sudo apt-get install lua5.3 liblua5.3-dev luarocks
# github ldoc is far ahead of the released version.
echo ldoc version:
git ls-remote https://github.com/lunarmodules/LDoc master
luarocks --local install https://raw.githubusercontent.com/lunarmodules/LDoc/master/ldoc-scm-3.rockspec
echo
cd ./doc
~/.luarocks/bin/ldoc .