-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (67 loc) · 2.34 KB
/
Copy pathdocs.yml
File metadata and controls
72 lines (67 loc) · 2.34 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
name: Python developer portal
on:
push:
branches: [main]
paths:
- 'src/**'
- 'docs/**'
- 'overrides/**'
- 'mkdocs.yml'
- 'pyproject.toml'
- 'scripts/check-docs-analytics.py'
- 'scripts/check-docs-layout.py'
- 'scripts/docstring_cross_references.py'
- '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-developer-portal
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install package and documentation dependencies
run: pip install -e '.[docs]'
- name: Install Chromium
run: python -m playwright install --with-deps chromium
- name: Build and check the portal
env:
CLOUDFLARE_WEB_ANALYTICS_TOKEN: ${{ vars.CLOUDFLARE_WEB_ANALYTICS_TOKEN }}
run: |
if ! printf '%s' "$CLOUDFLARE_WEB_ANALYTICS_TOKEN" | grep -Eq '^[a-f0-9]{32}$'; then
echo 'CLOUDFLARE_WEB_ANALYTICS_TOKEN must be the canonical 32-character site token' >&2
exit 1
fi
sed -i "s/__CLOUDFLARE_WEB_ANALYTICS_TOKEN__/$CLOUDFLARE_WEB_ANALYTICS_TOKEN/" \
docs/javascripts/analytics.js
mkdocs build --strict
python scripts/docstring_cross_references.py --site site
python scripts/check-docs-analytics.py site --require-token
python scripts/check-docs-layout.py site
test -s site/index.html
test "$(cat site/CNAME)" = "python.durable-workflow.com"
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
if: github.server_url == 'https://github.com'
with:
path: site
deploy:
if: ${{ github.server_url == 'https://github.com' && github.ref == 'refs/heads/main' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
pages: write
environment:
name: github-pages
url: https://python.durable-workflow.com/
steps:
- id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5