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:
|
2024-01-17 00:02:08 +01:00
|
|
|
- "api/lua/**"
|
2023-07-23 00:43:36 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-08-03 02:49:23 +02:00
|
|
|
paths:
|
2024-01-17 00:02:08 +01: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:
|
2024-01-17 00:02:08 +01:00
|
|
|
build-docs:
|
|
|
|
name: Build Lua docs
|
2024-01-15 01:08:17 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-06-14 21:56:32 +02:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-15 01:08:17 +01:00
|
|
|
- name: Get ldoc_gen
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: Ottatop/ldoc_gen
|
|
|
|
path: ./ldoc_gen
|
|
|
|
- name: Setup Lua
|
|
|
|
uses: leafo/gh-actions-lua@v10
|
|
|
|
with:
|
|
|
|
luaVersion: "5.4"
|
|
|
|
- name: Setup Lua Rocks
|
|
|
|
uses: leafo/gh-actions-luarocks@v4
|
|
|
|
- name: Setup dependencies
|
|
|
|
run: luarocks install ldoc
|
|
|
|
- name: Generate LDoc compatible code
|
2024-01-17 00:02:08 +01:00
|
|
|
run: mv ldoc_gen .. && cd ../ldoc_gen && cargo run -- -p ../pinnacle/api/lua
|
2024-01-15 01:08:17 +01:00
|
|
|
- name: Build docs
|
2024-01-16 06:37:17 +01:00
|
|
|
run: cd ../ldoc_gen/.ldoc_gen && cp ../../pinnacle/resources/ldoc.css ../../pinnacle/resources/config.ld . && ldoc .
|
2024-01-15 01:08:17 +01:00
|
|
|
- name: Deploy
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
2024-02-20 01:57:41 +01:00
|
|
|
deploy_key: ${{ secrets.DOCS_DEPLOY_KEY_LUA }}
|
|
|
|
external_repository: pinnacle-comp/lua-reference
|
2024-01-15 02:35:54 +01:00
|
|
|
publish_dir: ../ldoc_gen/.ldoc_gen/doc
|
2024-02-20 02:35:53 +01:00
|
|
|
destination_dir: ${{ env.BRANCH_NAME }}
|
2024-02-20 02:38:12 +01:00
|
|
|
# force_orphan: true
|