Repository navigation
71 lines (66 loc) · 2.06 KB
/
Copy pathdocs.yml
File metadata and controls
71 lines (66 loc) · 2.06 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
66
67
68
69
70
71
name: Docs
# Build the VitePress site on every docs change; deploy to GitHub Pages
# on main pushes. PRs only build (validation, no deploy).
# One-time setup: repository Settings -> Pages -> Source: "GitHub Actions".
on:
push:
branches: [main]
paths:
- docs/**
- .github/workflows/docs.yml
pull_request:
paths:
- docs/**
- .github/workflows/docs.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Install Bun
run: |
curl -fsSL -o /tmp/bun.zip \
https://github.com/oven-sh/bun/releases/download/bun-v1.4.0/bun-linux-x64.zip
python3 -m zipfile -e /tmp/bun.zip /tmp/bun-extract
mkdir -p ~/.bun/bin
mv /tmp/bun-extract/bun-linux-x64/bun ~/.bun/bin/bun
cp /tmp/bun-extract/bun-linux-x64/bunx ~/.bun/bin/bunx 2>/dev/null || true
rm -rf /tmp/bun.zip /tmp/bun-extract
chmod +x ~/.bun/bin/bun ~/.bun/bin/bunx 2>/dev/null || true
echo "$HOME/.bun/bin" >> "$GITHUB_PATH"
"$HOME/.bun/bin/bun" --version
shell: bash
- name: Cache bun install cache
uses: actions/cache@v6
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- run: bun run docs:build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5