Add doc generation job (#450)

* Add doc generation job

* Debug cargo doc

* Checkout submodules

* Remove unused build artifacts

* Remove debug commands

* Build on pushes to dev and main
This commit is contained in:
riordanp 2023-02-13 07:29:50 +00:00 committed by GitHub
parent 1f66bef88f
commit 6139c716ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 0 deletions

39
.github/workflows/ci-docs.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Build Docs
on:
push:
branches: [ main, dev ]
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Cache
uses: actions/cache@v2
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Build TS Client Docs
run: yarn typedoc ts/client/src/index.ts --readme none --out ./docs/ts/client/
- name: Build Rust Docs
run: cargo doc --no-deps --package client --package mango-v4 --target-dir ./docs/rs/ && rm -rf ./docs/rs/debug
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: docs

21
docs/index.html Normal file
View File

@ -0,0 +1,21 @@
<html>
<title>mango-v4 docs</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
a {
color: white;
}
</style>
</head>
<body style="background-color: #140f26">
<code style="margin: 0 auto; display: block; text-align: center; color: #fff">
<h1>mango-v4 docs</h1>
<ul style="list-style: none; margin: 0; padding: 0">
<li><a href="./rs/doc/mango_v4/">program</a></li>
<li><a href="./rs/doc/client/">rust client</a></li>
<li><a href="./ts/client/">typescript client</a></li>
</ul>
</code>
</body>
</html>