Merge pull request #740 from rpatters1/RGP-misc #245
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and optionally deploy scripts/docs | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
path: "./lua" | |
- name: Clean out dist folder | |
run: "rm -f ./lua/dist/*" | |
- name: Checkout docs website repository | |
if: github.event_name == 'push' && github.repository_owner == 'finale-lua' | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
repository: finale-lua/jw-lua-scripts-docs | |
path: "./website" | |
token: ${{ secrets.NICK_PERSONAL_TOKEN }} | |
- name: Install Pandoc | |
shell: bash | |
run: | | |
sudo apt update | |
sudo apt install -y pandoc | |
- name: Bundle scripts | |
uses: ./lua/.github/actions/bundle | |
with: | |
source: ./lua/src | |
output: ./lua/dist | |
- name: Create hashes | |
run: | | |
rm -rf ./lua/hash | |
mkdir ./lua/hash | |
cd ./lua/dist | |
for file in *; do sha512sum "$file" > "../hash/$(basename "$file" .lua).hash"; done | |
cd ../../ | |
- name: Install Lua | |
uses: leafo/gh-actions-lua@v10 | |
- name: Install LuaRocks | |
uses: leafo/gh-actions-luarocks@v4 | |
- name: Install lunajson | |
run: luarocks install lunajson | |
- name: Get metadata from scripts | |
uses: ./lua/.github/actions/get-metadata | |
with: | |
source: ./lua/src | |
output: ./website/src/lib/lib/script-data.json | |
- name: Generate the docs | |
uses: finale-lua/[email protected] | |
with: | |
input: "./lua/src/library" | |
repositoryUrl: "https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/library" | |
output: "./lua/docs/library" | |
- name: Generate the docs | |
uses: finale-lua/[email protected] | |
with: | |
input: "./lua/src/mixin" | |
repositoryUrl: "https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/mixin" | |
output: "./lua/docs/mixin" | |
- name: Copy docs to website folder | |
run: | | |
rm -rf website/docs | |
cp -R lua/docs website/docs | |
- name: Commit & push docs to website | |
if: github.event_name == 'push' && github.repository_owner == 'finale-lua' | |
uses: finale-lua/[email protected] | |
with: | |
github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} | |
directory: website | |
branch: main | |
repository: finale-lua/jw-lua-scripts-docs | |
- name: Commit & push changes to this repo | |
if: github.event_name == 'push' && github.repository_owner == 'finale-lua' | |
uses: finale-lua/[email protected] | |
with: | |
github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} | |
directory: lua | |
branch: ${{ github.ref }} |