docs: add build step for autodoc
Add build step to generate autodocs and add github workflow for publishing
This commit is contained in:
parent
9d87579076
commit
4069c83092
2 changed files with 48 additions and 0 deletions
38
.github/workflows/docs.yml
vendored
Normal file
38
.github/workflows/docs.yml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
name: docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v2
|
||||
- uses: goto-bus-stop/setup-zig@v2
|
||||
with:
|
||||
version: master
|
||||
- run: zig build docs
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v1
|
||||
with:
|
||||
path: "zig-out/docs"
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1
|
10
build.zig
10
build.zig
|
@ -60,4 +60,14 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
lints_step.dependOn(&lints.step);
|
||||
b.default_step.dependOn(lints_step);
|
||||
|
||||
// Docs
|
||||
const vaxis_docs = tests;
|
||||
const build_docs = b.addInstallDirectory(.{
|
||||
.source_dir = vaxis_docs.getEmittedDocs(),
|
||||
.install_dir = .prefix,
|
||||
.install_subdir = "docs",
|
||||
});
|
||||
const build_docs_step = b.step("docs", "Build the vaxis library docs");
|
||||
build_docs_step.dependOn(&build_docs.step);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue