-
Notifications
You must be signed in to change notification settings - Fork 10
114 lines (102 loc) · 3.29 KB
/
Copy pathdocs.yml
File metadata and controls
114 lines (102 loc) · 3.29 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Documentation
on:
push:
branches: [main]
paths:
- 'docs/**'
- 'dev-tools/docs/**'
- 'src/**/cli/**'
- 'README.md'
- '*.md'
- 'pyproject.toml'
- '.github/workflows/docs.yml'
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'dev-tools/docs/**'
- 'src/**/cli/**'
- 'README.md'
- '*.md'
- 'pyproject.toml'
- '.github/workflows/docs.yml'
# workflow_dispatch: allows triggering docs builds manually from the Actions UI
workflow_dispatch:
# NOTE: workflow_run trigger removed. It fired after "Quality Checks" and
# "Unit Tests" completed, causing docs to build twice on every main push
# (once from push: and once from workflow_run:). The push: trigger is
# sufficient — it runs immediately and is path-scoped to docs-relevant files.
permissions:
contents: write # mike pushes to gh-pages branch
pages: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
config:
name: Get Configuration
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
default-python-version: ${{ steps.config.outputs.default-python-version }}
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Get project configuration
id: config
uses: ./.github/actions/get-config
setup-cache:
name: Setup Cache
needs: config
uses: ./.github/workflows/cache-management.yml
with:
cache-type: dependencies
cache-key-base: docs-deps
python-version: ${{ needs.config.outputs.default-python-version }}
build:
needs: [config, setup-cache]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup Python and UV
uses: ./.github/actions/setup-uv-cached
with:
cache-key: ${{ needs.setup-cache.outputs.cache-key }}
fail-on-cache-miss: false
- name: Build documentation
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
# Deploy dev alias via mike, export docs/site for Pages upload.
bash dev-tools/docs/mike_deploy.sh dev --push
else
# PR path: strict build validation only — no versioning, no push.
make ci-docs-build
fi
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
with:
path: docs/site
deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 20
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Smoke-check deployed site
run: bash dev-tools/docs/smoke_check_pages.sh "${{ steps.deployment.outputs.page_url }}"