forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.73 KB
/
Copy pathdocs-sync.yml
File metadata and controls
65 lines (54 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Docs Sync
on:
push:
branches: [main]
paths:
# Trigger when compiler / stdlib source or docs content change.
- 'src/**'
- 'examples/**'
- 'scripts/**'
- 'docs/**'
- '.github/workflows/docs-sync.yml'
jobs:
sync-docs:
name: Sync Standard Library Docs
runs-on: ubuntu-latest
permissions:
contents: write # Required for auto-committing doc changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Enable corepack
run: corepack enable
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Generate docs
run: node scripts/generate-docs.js
- name: Commit and push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/src/content/docs/stdlib/ docs/api.md
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "docs: auto-sync stdlib reference [skip ci]"
git push
fi
- name: Build Astro site
run: |
cd docs
pnpm install
pnpm run build
# Deployment is handled by the Cloudflare Pages Git integration,
# which triggers on every push to main. This step validates the build.