Skip to content

Gen Docs

Gen Docs #109

Workflow file for this run

name: Gen Docs
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'docs/**'
- 'src/builtins/**'
jobs:
deploy:
runs-on: ubuntu-22.04
env:
ZIG_VERSION: 0.11.0
steps:
- name: Clone repo.
uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Install zig.
run: |
wget -c https://ziglang.org/builds/zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin
- name: Build md4c.
run: |
git clone --depth=1 https://github.com/mity/md4c.git
cd md4c
mkdir build
cd build
cmake ..
make
- name: Cache.
uses: actions/cache@v2
with:
path: |-
~/.cache/zig
zig-cache
key:
build-1
restore-keys:
build-1
- name: Build Cyber.
run: zig build cli
- name: Generate docs.
run: |
LD_LIBRARY_PATH=`pwd`/md4c/build/src` zig-out/bin/cyber docs/gen-docs.cy
mkdir -p docs/public
mv docs/docs.html docs/public/index.html
- name: Deploy.
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public