Skip to content

Commit b7b66cc

Browse files
authored
Merge pull request #32 from contentauth/add-doc-publish-wf
docs: Add docs publish workflow
2 parents ebce60d + 83c30f1 commit b7b66cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+115
-3193
lines changed

.github/workflows/publish-docs.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and publish docs
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: 'github-pages'
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v5
26+
27+
- uses: pnpm/action-setup@v4
28+
name: Install pnpm
29+
with:
30+
run_install: false
31+
32+
- name: Install Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
cache: pnpm
37+
38+
- name: Install dependencies
39+
env:
40+
SKIP_RUST_BUILD: 1
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Generate TypeDoc markdown (without modifying repo)
44+
run: |
45+
pnpm run build:docs
46+
rm -rf docs-typedoc
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Build with Jekyll
52+
uses: actions/jekyll-build-pages@v1
53+
with:
54+
source: ./docs
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
# Upload the built site for deployment
60+
path: '_site'
61+
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ _site
44
.jekyll-metadata
55
vendor
66
Gemfile.lock
7+
8+
globals.md
9+

docs/README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
---
2-
title: README
3-
layout: none
4-
---
1+
# API documentation for CAI Node.js library
52

6-
**@contentauth/c2pa-node**
3+
The files in these directories are generated by TypeDoc (except for `index.md`). The files are generated into these directories in the workflow ONLY; they are not checked in:
74

8-
***
5+
- `classes`
6+
- `functions`
7+
- `interfaces`
8+
- `type-aliases`
99

10-
# @contentauth/c2pa-node
10+
All the other files under `/docs` (which are checked in) are used to scaffold the Jekyll site.
1111

12-
## [Classes](classes/index.md)
13-
14-
{% include_relative classes/index.md %}
15-
16-
## [Interfaces](interfaces/index.md)
17-
18-
{% include_relative interfaces/index.md %}
19-
20-
## [Type Aliases](type-aliases/index.md)
21-
22-
{% include_relative type-aliases/index.md %}
23-
24-
## [Functions](functions/index.md)
25-
26-
{% include_relative functions/index.md %}
12+
The `publish-docs.yml` workflow runs TypeDoc, runs Jekyll, and publishes the resulting HTML using GitHub Pages.

docs/_includes/sidebar.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
{%- assign readme_page = site.pages | where: "name", "README.md" | first -%}
1+
{%- assign sidebar = site.pages | where: "name", "globals.md" | first -%}
2+
3+
<nav class="sidebar-content">
4+
{{ sidebar.content | strip | markdownify }}
5+
</nav>
6+
7+
28

3-
{%- if readme_page -%}
4-
<nav class="sidebar-content">
5-
{{ readme_page.content | strip | markdownify }}
6-
</nav>
7-
{%- endif -%}
89

910

docs/classes/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ignore everything
2+
*.md
3+
4+
# Don't ignore .gitignore itself
5+
!.gitignore
6+
7+
# Don't ignore the README file
8+
!index.md

0 commit comments

Comments
 (0)