Merge pull request #25 from 1337joe/renovate/ci-deps #79
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: Generate Docs | |
on: | |
push: | |
branches: [ main, pts ] | |
# pull_request: | |
# branches: [ main ] | |
jobs: | |
codex: | |
name: Generate Codex | |
runs-on: ubuntu-latest | |
env: | |
LDOC_CONFIG: "${{ github.ref == 'refs/heads/pts' && 'config-pts.ld' || 'config.ld' }}" | |
CODEX_SUFFIX: "${{ github.ref == 'refs/heads/pts' && 'codex-pts' || 'codex' }}" | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e # v10.0.0 | |
- uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5 # v4.3.0 | |
- name: Setup | |
run: | | |
luarocks install ldoc | |
mkdir docs | |
- name: Build mock codex | |
run: | | |
ldoc -c $LDOC_CONFIG . | |
mv doc docs/mock-codex | |
- name: Remove mock methods | |
run: | | |
find src/dumocks -name \*.lua -exec sed -i 's/--- Mock/-- Mock/g' {} + | |
- name: Build web codex | |
run: | | |
ldoc -c $LDOC_CONFIG . | |
mv doc docs/web-codex | |
- name: Clean up CSS | |
run: | | |
find docs -name ldoc.css -exec sed -i 's/width: 700px;//g' {} + | |
- name: Deploy Web Codex | |
uses: JamesIves/github-pages-deploy-action@a96ffa23204731ec64e3e1316072197d98bfbaea # v4.6.6 | |
with: | |
branch: codex | |
folder: docs/web-codex | |
target-folder: web-${{ env.CODEX_SUFFIX }} | |
- name: Deploy Mock Codex | |
uses: JamesIves/github-pages-deploy-action@a96ffa23204731ec64e3e1316072197d98bfbaea # v4.6.6 | |
with: | |
branch: codex | |
folder: docs/mock-codex | |
target-folder: mock-${{ env.CODEX_SUFFIX }} |