Skip to content

Commit 1354eec

Browse files
authored
Add vitepress doc site. #27
2 parents d41cd3b + 083af9e commit 1354eec

32 files changed

+6940
-613
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "cargo" # See documentation for possible values
9-
directory: "/" # Location of package manifests
8+
- package-ecosystem: 'cargo' # See documentation for possible values
9+
directory: '/' # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: 'weekly'

.github/workflows/deploy-docs.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Deploy VitePress Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/deploy-docs.yml'
9+
workflow_dispatch: # Allow manual triggers
10+
11+
# Sets permissions for GitHub Pages deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Prevent concurrent deployments
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0 # For lastUpdated feature
30+
31+
- name: Retrieve Node.js version
32+
id: node-version
33+
run: |
34+
if [ -f .tool-versions ]; then
35+
echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
36+
else
37+
echo "node-version=20" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: ${{ steps.node-version.outputs.node-version }}
44+
cache: 'npm'
45+
cache-dependency-path: docs/package-lock.json
46+
47+
- name: Setup Pages
48+
uses: actions/configure-pages@v4
49+
50+
- name: Install dependencies
51+
working-directory: docs
52+
run: npm ci
53+
54+
- name: Build with VitePress
55+
working-directory: docs
56+
run: npm run build
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: docs/.vitepress/dist
62+
63+
deploy:
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
needs: build
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Deploy to GitHub Pages
71+
id: deployment
72+
uses: actions/deploy-pages@v4

.github/workflows/format.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Run Format"
1+
name: 'Run Format'
22

33
on:
44
push:
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set up rust toolchain
3939
uses: actions-rust-lang/setup-rust-toolchain@v1
4040
with:
41-
components: "clippy, rustfmt"
41+
components: 'clippy, rustfmt'
4242
toolchain: ${{ steps.rust-version.outputs.rust-version }}
4343

4444
- name: Fetch dependencies (locked)
@@ -49,3 +49,34 @@ jobs:
4949

5050
- name: Run cargo clippy
5151
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
52+
53+
format-docs:
54+
runs-on: ubuntu-latest
55+
defaults:
56+
run:
57+
working-directory: docs
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Retrieve Node.js version
63+
id: node-version
64+
working-directory: .
65+
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
66+
shell: bash
67+
68+
- name: Use Node.js
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ steps.node-version.outputs.node-version }}
72+
cache: 'npm'
73+
cache-dependency-path: docs/package.json
74+
75+
- name: Install dependencies
76+
run: npm ci
77+
78+
- name: Run ESLint
79+
run: npm run lint
80+
81+
- name: Run Prettier (check)
82+
run: npm run format

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Run Tests"
1+
name: 'Run Tests'
22

33
on:
44
push:

.tool-versions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
fasltly v13.3.0
1+
fasltly v13.0.0
2+
nodejs 24.12.0
23
rust 1.91.1

0 commit comments

Comments
 (0)