-
-
Notifications
You must be signed in to change notification settings - Fork 587
76 lines (65 loc) · 1.86 KB
/
Copy pathdocs-site.yml
File metadata and controls
76 lines (65 loc) · 1.86 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
name: Docs Site
on:
push:
branches: [main]
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
workflow_dispatch:
concurrency:
group: docs-site-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_deploy:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
name: Build and deploy docs site
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
# Full history so VitePress lastUpdated timestamps are accurate
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
working-directory: docs
run: npm ci
- name: Build VitePress site
working-directory: docs
run: npx vitepress build .
- name: Deploy to Azure Static Web Apps
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DOCS }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: 'docs/.vitepress/dist'
skip_app_build: true
build_check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Build check (docs site)
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: docs/package-lock.json
- name: Install dependencies
working-directory: docs
run: npm ci
- name: Build VitePress site
working-directory: docs
run: npx vitepress build .