Skip to content

Commit eae6c20

Browse files
committed
feat: add GitHub Actions workflow for documentation deployment
1 parent bba63da commit eae6c20

2 files changed

Lines changed: 75 additions & 1 deletion

File tree

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'tshtml/src/**'
8+
- 'tshtml/package.json'
9+
- 'docs/**'
10+
- '.github/workflows/docs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: '20.x'
33+
cache: 'npm'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Build documentation
39+
run: npm run docs
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: './docs'
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

docs/github-workflows.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The monorepo uses **GitHub Actions** to automate:
2020

2121
## Workflow Files
2222

23-
Two GitHub Actions workflow files control the process:
23+
Three GitHub Actions workflow files control the process:
2424

2525
### 1. `.github/workflows/ci.yml` - Continuous Integration
2626

@@ -62,6 +62,22 @@ After the Version PR is merged, the workflow:
6262

6363
**Important**: Publish only happens after Version PR merge. You control the timing.
6464

65+
### 3. `.github/workflows/docs.yml` - Documentation Deployment
66+
67+
**Triggers**: Runs on pushes to `main` when changes touch:
68+
- Source files in `tshtml/src/**`
69+
- `tshtml/package.json`
70+
- Documentation in `docs/**`
71+
- The docs workflow file itself
72+
- Can also be manually triggered via `workflow_dispatch`
73+
74+
**What it does**:
75+
1. Builds TypeDoc documentation (`npm run docs`)
76+
2. Uploads documentation artifacts to GitHub Pages
77+
3. Deploys to https://xorets.github.io/tshtml/
78+
79+
**Status**: Documentation is automatically updated on every push to `main` that affects source code or docs.
80+
6581
## Local Development (Recommended)
6682

6783
For day-to-day development, use the monorepo’s `npm link` tooling so you can iterate on `tshtml` / `tshtml-loader` without publishing.

0 commit comments

Comments
 (0)