Repository navigation
152 lines (133 loc) · 4.48 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
152 lines (133 loc) · 4.48 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Deploy MkDocs to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Weekly: check every link in the docs (the link-check job only).
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
# Pull-request builds never deploy, so each PR gets its own group. Sharing
# `pages` with them let GitHub cancel a queued main deploy (#194).
group: ${{ github.event_name == 'pull_request' && format('pages-pr-{0}', github.event.pull_request.number) || 'pages' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v4
with:
auto-activate-base: false
activate-environment: solidworks_mcp
environment-file: solidworks_mcp.yml
- name: Install package
shell: bash -el {0}
run: conda run -n solidworks_mcp pip install -e ".[dev,test,docs]"
- name: Run test suite
shell: bash -el {0}
run: make test
# Build job
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
"mkdocs==1.6.1" \
"mkdocs-material==9.7.5" \
"mkdocstrings[python]==1.0.3" \
"mkdocs-gen-files==0.6.0" \
"mkdocs-literate-nav==0.6.2" \
"mkdocs-section-index==0.3.10" \
"mkdocs-autorefs==1.4.4" \
"mkdocs-minify-plugin==0.8.0" \
"mkdocs-awesome-pages-plugin==2.10.1" \
"mkdocs-mermaid2-plugin==1.2.3" \
"pymdown-extensions==11.0.1"
# pymdown-extensions is a transitive dep of mkdocs-material; left
# unpinned, 12.x's Highlight(md) signature change broke the build
# ("Highlight.__init__() missing 1 required positional argument: 'md'").
# Keep it in sync with uv.lock.
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
- name: Build with MkDocs
# DISABLE_MKDOCS_2_WARNING suppresses a warning injected by plugin(s)
# recommending installation of 'properdocs'. Do NOT install properdocs —
# the warning is unsolicited plugin behavior, not an official MkDocs notice.
env:
DISABLE_MKDOCS_2_WARNING: 'true'
run: mkdocs build --clean
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./site
# Deployment job
deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
# Every link in the README, the docs and llms.txt, after each deploy and
# weekly (spec docs/link-check). A failure flags a link to fix; it does not
# undo the deploy.
link-check:
if: >-
always() && (github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
needs.deploy.result == 'success')
runs-on: ubuntu-latest
needs: deploy
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.13'
- name: Install package
run: |
python -m pip install --upgrade pip
pip install -e . "pyyaml>=6.0"
- name: Check every link
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python -m solidworks_mcp.doc_links check-external
- name: Upload the link report
if: always()
uses: actions/upload-artifact@v7
with:
name: link-report
path: tests/.generated/link-report.md