pinnacle/.github/workflows/ldoc.yml

44 lines
1.1 KiB
YAML
Raw Normal View History

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
name: Build Docs
on:
pull_request:
branches:
- main
2023-08-03 02:49:23 +02:00
paths:
- "api/lua/doc/**"
2023-07-23 00:43:36 +02:00
push:
branches:
- main
2023-08-03 02:49:23 +02:00
paths:
- "api/lua/doc/**"
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
uses: actions/checkout@v3
- 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 dependencies
run: luarocks install ldoc
- name: Build docs
run: cd ./api/lua/doc && ldoc . && cd ../../..
2023-07-23 00:43:36 +02:00
- name: Deploy
2023-07-23 01:01:17 +02:00
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
2023-07-23 00:43:36 +02:00
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./api/lua/doc/doc
2023-07-23 22:30:41 +02:00
destination_dir: ${{ env.BRANCH_NAME }}