Repository navigation
43 lines (39 loc) · 1.68 KB
/
Copy pathpages.yml
File metadata and controls
43 lines (39 loc) · 1.68 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
# Builds the 運作說明 (How it works) page (docs/guide/guide.py) in Chinese and English and publishes it on GitHub
# Pages: zh/ and en/, plus an index.html that sends a reader to their language. The page looks up its
# line numbers in the code it is built from, so it is rebuilt on every push to main, once its tests
# have checked that it still matches that code.
name: 運作說明 on GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.0
with:
version-file: pyproject.toml # its required-version: no uv older than the fix for the revoked emSign certificates
# The page needs only pygments, not torch and the rest of the app, and its tests only pytest
# besides. They fail when an edit moved or removed a line the page points at, or changed code it
# quotes since its text was last reread (tests/guide_excerpts.txt); the page already up then stays.
# checks.yml's guide job runs these two on every pull request, so keep the two the same.
- run: uv run --isolated --no-project --with pygments --with pytest pytest tests/test_guide.py
- run: uv run --isolated --no-project --with pygments python -m docs.guide _site
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v5