2023-07-23 00:43:36 +02:00
|
|
|
# From https://github.com/lunarmodules/ldoc/blob/master/.github/workflows/doc.yml
|
|
|
|
|
|
|
|
# Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
|
2023-10-21 03:13:17 +02:00
|
|
|
name: Build Lua Docs
|
2023-07-23 00:43:36 +02:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-08-03 02:49:23 +02:00
|
|
|
paths:
|
2023-09-06 05:15:57 +02:00
|
|
|
- "api/lua/**"
|
2023-07-23 00:43:36 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-08-03 02:49:23 +02:00
|
|
|
paths:
|
2023-09-06 05:15:57 +02:00
|
|
|
- "api/lua/**"
|
2023-10-21 04:24:00 +02:00
|
|
|
workflow_dispatch:
|
2023-07-23 22:25:11 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
2023-07-23 00:43:36 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-21 03:13:17 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-08-27 05:34:26 +02:00
|
|
|
- name: Get ldoc_gen
|
2023-10-21 03:13:17 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-08-27 05:34:26 +02:00
|
|
|
with:
|
|
|
|
repository: Ottatop/ldoc_gen
|
|
|
|
path: ./ldoc_gen
|
2023-07-23 00:43:36 +02:00
|
|
|
- name: Setup Lua
|
2023-12-21 02:54:34 +01:00
|
|
|
uses: leafo/gh-actions-lua@v10
|
2023-07-23 00:43:36 +02:00
|
|
|
with:
|
2023-12-21 03:00:13 +01:00
|
|
|
luaVersion: "5.4"
|
2023-07-23 00:43:36 +02:00
|
|
|
- name: Setup Lua Rocks
|
|
|
|
uses: leafo/gh-actions-luarocks@v4
|
|
|
|
- name: Setup dependencies
|
|
|
|
run: luarocks install ldoc
|
2023-08-27 05:26:32 +02:00
|
|
|
- name: Generate LDoc compatible code
|
2023-08-27 05:34:26 +02:00
|
|
|
run: cd ./ldoc_gen && cargo run -- -p ../api/lua
|
2023-07-23 00:43:36 +02:00
|
|
|
- name: Build docs
|
2023-08-27 06:09:07 +02:00
|
|
|
run: cd ./ldoc_gen/.ldoc_gen && cp ../../api/lua/ldoc.css ../../api/lua/config.ld . && ldoc . && cd ../..
|
2023-07-23 00:43:36 +02:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-27 05:26:32 +02:00
|
|
|
publish_dir: ./ldoc_gen/.ldoc_gen/doc
|
2023-10-21 03:13:17 +02:00
|
|
|
destination_dir: ${{ env.BRANCH_NAME }}/lua
|