Fixed md formatting and update docs on pushes #10
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Update documentation | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
paths-ignore: | |
- ".github/**" | |
env: | |
CI_DEPLOY_DIR: luacs-docs/ci-deploy | |
CI_ARTIFACTS_DIR: luacs-docs/ci-artifacts | |
jobs: | |
update-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 | |
with: | |
dotnet-version: | | |
6.0.x | |
- uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e # v10.0.0 | |
with: | |
luaVersion: "5.2" | |
- uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5 # v4.3.0 | |
- name: Install doxygen | |
run: ./install_doxygen.sh | |
- name: Install mkdocs | |
run: sudo apt-get update && sudo apt-get install -y python3 python3-pip && pip install mkdocs-material | |
- name: Build Manual | |
run: ./build_manual.sh | |
- name: Build Lua API Reference | |
run: ./build_api_lua.sh | |
- name: Build CS API Reference | |
run: ./build_api_cs.sh | |
- name: Create tarball | |
run: | | |
mkdir -p "$CI_ARTIFACTS_DIR" | |
tar -czf "$CI_ARTIFACTS_DIR"/docs.tar.gz -C ./build . | |
- name: Upload tarball | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: docs | |
path: ${{ env.CI_ARTIFACTS_DIR }}/docs.tar.gz | |
deploy-docs: | |
runs-on: ubuntu-latest | |
needs: [update-docs] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- run: mkdir -p "$CI_ARTIFACTS_DIR" "$CI_DEPLOY_DIR" | |
- name: "Download build artifacts" | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: docs | |
path: ${{ env.CI_ARTIFACTS_DIR }} | |
- name: Extract docs tarballs | |
run: | | |
tar -xzf "$CI_ARTIFACTS_DIR"/docs.tar.gz -C "$CI_DEPLOY_DIR" | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e #v4.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.CI_DEPLOY_DIR }} | |
keep_files: true |