Skip to content

Commit e2bdc4f

Browse files
committed
ci: check the docs site answers, not just that the deploy returned
A deploy that succeeded and a site that works are different claims, and only the first was being checked. Four URLs now: the English root, the install page, its Chinese translation, and the FAQ — chosen because a broken locale build or a missing translated route would pass every other step in this workflow. It runs on the runner because Cloudflare rejects some clients by user agent, which is also why this could not be checked from a laptop.
1 parent 5af9745 commit e2bdc4f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,27 @@ jobs:
142142
print(f"cloudflare: {e.get('code')} {e.get('message')}", file=sys.stderr)
143143
sys.exit(1)
144144
CHECK
145+
146+
# A deploy that succeeded and a site that works are different claims.
147+
# This checks the second one: the English root, a translated page, and
148+
# the page whose whole job is handing somebody a download.
149+
#
150+
# Cloudflare rejects some clients by user agent, so this runs here
151+
# rather than from a laptop.
152+
- if: ${{ github.event_name != 'pull_request' && vars.CLOUDFLARE_ACCOUNT_ID != '' }}
153+
name: Check the site actually answers
154+
run: |
155+
failed=0
156+
for path in "" "getting-started/install" "zh-CN/getting-started/install" "help/faq"; do
157+
code=000
158+
# Propagation after the first deploy of a new domain takes a
159+
# moment; three tries rather than a flaky red run.
160+
for attempt in 1 2 3; do
161+
code=$(curl -sS -o /tmp/page -m 25 -w '%{http_code}' -L "https://docs.opencli.ai/$path" || echo 000)
162+
[ "$code" = "200" ] && break
163+
sleep 15
164+
done
165+
echo "$code /$path"
166+
[ "$code" = "200" ] || failed=1
167+
done
168+
exit $failed

0 commit comments

Comments
 (0)