forked from google/A2UI
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (81 loc) · 2.79 KB
/
docs.yml
File metadata and controls
95 lines (81 loc) · 2.79 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
87
88
89
90
91
92
93
94
95
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Docs Build and Deploy
on:
push:
branches:
- main
paths:
- ".github/workflows/docs.yml"
- "requirements-docs.txt"
- "mkdocs.yml"
- "docs/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/docs.yml"
- "requirements-docs.txt"
- "mkdocs.yml"
- "docs/**"
jobs:
build_and_deploy:
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
if: github.repository == 'google/A2UI'
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Configure Git Credentials
run: |
git config --global user.name github-actions[bot]
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Restore pip cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}
path: ~/.cache/pip
restore-keys: |
${{ runner.os }}-pip-
- name: Install documentation dependencies
run: pip install -r requirements-docs.txt
- name: Validate documentation conversion script
run: pip install pytest && pytest docs/scripts/test_convert_docs.py
- name: Copy schemas to documentation
run: |
cp -R specification/* docs/specification/
# Flatten JSON files to version roots to support clean URLs without redirects
for version in v0_8 v0_9; do
if [ -d "docs/specification/$version/json" ]; then
cp docs/specification/$version/json/*.json docs/specification/$version/
fi
done
- name: Convert Admonitions in Documentation
run: python docs/scripts/convert_docs.py
- name: Build Documentation (PR Check)
if: github.event_name == 'pull_request'
run: mkdocs build
- name: Deploy development version from main branch
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdocs gh-deploy