-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (73 loc) · 2.25 KB
/
docs.yml
File metadata and controls
86 lines (73 loc) · 2.25 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Documentation
# Build and deploy documentation to GitHub Pages
# - On push to main with docs changes: Build and deploy
# - Standalone workflow for documentation deployment only
on:
push:
branches: [main]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build documentation using vx
build:
name: Build Documentation (via vx)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup vx
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: "false"
- name: Cache vx tools
uses: actions/cache@v5
with:
path: ~/.vx
key: ${{ runner.os }}-vx-docs-${{ hashFiles('docs/package-lock.json') }}
restore-keys: |
${{ runner.os }}-vx-docs-
# vx automatically installs Node.js when running npm commands
# No need for explicit "vx install node" step
- name: Install dependencies
run: |
# Ensure system paths are available for npm postinstall scripts
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
vx just docs-install
- name: Build documentation
run: vx just docs-build
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs/.vitepress/dist
# Deploy to GitHub Pages
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
- name: Summary
run: |
echo "## Documentation Deployed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Documentation has been deployed to GitHub Pages!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "URL: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY