pinnacle/.github/workflows/ldoc.yml

53 lines
1.5 KiB
YAML
Raw Normal View History

2023-07-22 17:43:36 -05:00
# From https://github.com/lunarmodules/ldoc/blob/master/.github/workflows/doc.yml
# Based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
name: Build Lua Docs
2023-07-22 17:43:36 -05:00
on:
pull_request:
branches:
- main
2023-08-02 19:49:23 -05:00
paths:
2024-01-16 17:02:08 -06:00
- "api/lua/**"
2023-07-22 17:43:36 -05:00
push:
branches:
- main
2023-08-02 19:49:23 -05:00
paths:
2024-01-16 17:02:08 -06:00
- "api/lua/**"
2023-10-20 21:24:00 -05:00
workflow_dispatch:
2023-07-23 15:25:11 -05:00
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
2023-07-22 17:43:36 -05:00
jobs:
2024-01-16 17:02:08 -06:00
build-docs:
name: Build Lua docs
2024-01-14 18:08:17 -06:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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-16 17:02:08 -06:00
run: mv ldoc_gen .. && cd ../ldoc_gen && cargo run -- -p ../pinnacle/api/lua
2024-01-14 18:08:17 -06:00
- name: Build docs
2024-01-15 23:37:17 -06:00
run: cd ../ldoc_gen/.ldoc_gen && cp ../../pinnacle/resources/ldoc.css ../../pinnacle/resources/config.ld . && ldoc .
2024-01-14 18:08:17 -06:00
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
2024-02-19 18:57:41 -06:00
deploy_key: ${{ secrets.DOCS_DEPLOY_KEY_LUA }}
external_repository: pinnacle-comp/lua-reference
publish_dir: ../ldoc_gen/.ldoc_gen/doc
destination_dir: ${{ env.BRANCH_NAME }}
# force_orphan: true