Skip to content

Commit

Permalink
docs: add build step for autodoc
Browse files Browse the repository at this point in the history
Add build step to generate autodocs and add github workflow for
publishing
  • Loading branch information
00JCIV00 authored and rockorager committed Feb 26, 2024
1 parent 9d87579 commit 4069c83
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 4069c83

Please sign in to comment.