Repository navigation
105 lines (91 loc) · 3.89 KB
/
Copy pathdocs.yml
File metadata and controls
105 lines (91 loc) · 3.89 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
name: Docs
on:
push:
branches: [main]
pull_request:
workflow_dispatch: # manual retrigger, no commit needed
schedule:
# Safety net: a push to `main` that never dispatches this workflow (a
# dropped webhook/event — rare, but observed) would otherwise leave
# Pages silently stale with no error anywhere. This rebuilds and
# redeploys from `main` daily regardless, so staleness self-heals
# within a day instead of needing someone to notice.
#
# It also refreshes the verification results rendered at build time (see
# "Render the verification reports"): the runtime's nightly fuzz run
# publishes around 03:30 UTC, so this picks it up the same morning.
- cron: '0 6 * * *'
permissions:
contents: read
# A newer push to the same pull request supersedes this run. A run on `main`
# is never cancelled: it may be the one deploying.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: 3.14.10
# Poetry itself comes from a hash-pinned requirements file (poetry and
# every package it needs, compiled with pip-compile); the site's own
# packages come from poetry.lock, whose hashes `poetry install` checks.
- name: Install Poetry
run: pip install --require-hashes --no-deps -r .github/poetry-requirements.txt
- name: Install dependencies
working-directory: docs
run: poetry install
# The runtimes' benchmark and fuzzing results change with every runtime
# push and nightly run, so they're fetched now instead of committed;
# the pages include what this writes (docs/_generated/, ignored). A
# report that can't be fetched renders as "not published yet", so this
# never fails the build; the timeout and continue-on-error are a
# second guard.
- name: Render the verification reports
timeout-minutes: 2
continue-on-error: true
run: python3 scripts/sync-language-support.py --render-reports
- name: Build site
working-directory: docs
run: poetry run zensical build --strict
# zensical doesn't run Jinja (the macros plugin was silently ignored and
# the CLI page shipped a raw `{% for %}` loop), and --strict doesn't
# notice. Any template syntax left in a built page fails the build.
- name: No unrendered template syntax
working-directory: docs
run: |
if grep -rl --include='*.html' -e '{{ ' -e '{% ' site; then
echo "::error::the pages above contain unrendered {{ }} or {% %}"
exit 1
fi
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/site
deploy:
needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1